summaryrefslogtreecommitdiff
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2022-08-18 23:59:55 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-08-23 19:55:14 +0300
commitb75d2cd06b33956b7ec35c6316e717c25a196ee5 (patch)
treeee261550191653e47a5e07c6d48d58f028d97867 /drivers/acpi/bus.c
parent1c23f9e627a7b412978b4e852793c5e3c3efc555 (diff)
downloadlinux-b75d2cd06b33956b7ec35c6316e717c25a196ee5.tar.xz
ACPI: move from strlcpy() with unused retval to strscpy()
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index c0d20d997891..1d29f5dc7d79 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -802,7 +802,7 @@ static bool acpi_of_modalias(struct acpi_device *adev,
str = obj->string.pointer;
chr = strchr(str, ',');
- strlcpy(modalias, chr ? chr + 1 : str, len);
+ strscpy(modalias, chr ? chr + 1 : str, len);
return true;
}
@@ -822,7 +822,7 @@ void acpi_set_modalias(struct acpi_device *adev, const char *default_id,
char *modalias, size_t len)
{
if (!acpi_of_modalias(adev, modalias, len))
- strlcpy(modalias, default_id, len);
+ strscpy(modalias, default_id, len);
}
EXPORT_SYMBOL_GPL(acpi_set_modalias);