]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86: thinkpad_acpi: Use 2-argument strscpy()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Sun, 2 Jun 2024 08:57:59 +0000 (11:57 +0300)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 3 Jun 2024 11:51:44 +0000 (14:51 +0300)
Use 2-argument strscpy(), which is not only shorter but also provides
an additional check that destination buffer is an array.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240602090244.1666360-7-andy.shevchenko@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c

index 397b409064c9960634a9a46ba4b2dd7f64a98a75..f269ca1ff7718df64a1d346cc2058d6038abdc6d 100644 (file)
@@ -7416,10 +7416,8 @@ static int __init volume_create_alsa_mixer(void)
        data = card->private_data;
        data->card = card;
 
-       strscpy(card->driver, TPACPI_ALSA_DRVNAME,
-               sizeof(card->driver));
-       strscpy(card->shortname, TPACPI_ALSA_SHRTNAME,
-               sizeof(card->shortname));
+       strscpy(card->driver, TPACPI_ALSA_DRVNAME);
+       strscpy(card->shortname, TPACPI_ALSA_SHRTNAME);
        snprintf(card->mixername, sizeof(card->mixername), "ThinkPad EC %s",
                 (thinkpad_id.ec_version_str) ?
                        thinkpad_id.ec_version_str : "(unknown)");