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/utils.c | |
parent | 1c23f9e627a7b412978b4e852793c5e3c3efc555 (diff) |
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/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 5a7b8065e77f..4acd6f7d1395 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -878,7 +878,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) struct acpi_dev_match_info match = {}; struct device *dev; - strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); + strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; @@ -911,7 +911,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha struct acpi_dev_match_info match = {}; struct device *dev; - strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); + strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; @@ -961,7 +961,7 @@ EXPORT_SYMBOL(acpi_video_backlight_string); static int __init acpi_backlight(char *str) { - strlcpy(acpi_video_backlight_string, str, + strscpy(acpi_video_backlight_string, str, sizeof(acpi_video_backlight_string)); return 1; } |