diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2022-08-18 22:59:55 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-23 18:55:14 +0200 |
commit | b75d2cd06b33956b7ec35c6316e717c25a196ee5 (patch) | |
tree | ee261550191653e47a5e07c6d48d58f028d97867 /drivers/acpi/bus.c | |
parent | Linux 6.0-rc2 (diff) | |
download | linux-b75d2cd06b33956b7ec35c6316e717c25a196ee5.tar.xz linux-b75d2cd06b33956b7ec35c6316e717c25a196ee5.zip |
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.c | 4 |
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); |