[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240602090244.1666360-6-andy.shevchenko@gmail.com>
Date: Sun, 2 Jun 2024 11:57:58 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hans de Goede <hdegoede@...hat.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Jorge Lopez <jorge.lopez2@...com>,
Li Zetao <lizetao1@...wei.com>,
Simon Trimmer <simont@...nsource.cirrus.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Mark Pearson <mpearson-lenovo@...ebb.ca>,
platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org,
ibm-acpi-devel@...ts.sourceforge.net,
linux-input@...r.kernel.org
Cc: Corentin Chary <corentin.chary@...il.com>,
"Luke D. Jones" <luke@...nes.dev>,
Mark Pearson <markpearson@...ovo.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>
Subject: [PATCH v1 5/7] platform/x86: think-lmi: Use 2-argument strscpy()
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@...il.com>
---
drivers/platform/x86/think-lmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 0f2264bb7577..4cfb53206cb8 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -1508,7 +1508,7 @@ static struct tlmi_pwd_setting *tlmi_create_auth(const char *pwd_type,
if (!new_pwd)
return NULL;
- strscpy(new_pwd->kbdlang, "us", TLMI_LANG_MAXLEN);
+ strscpy(new_pwd->kbdlang, "us");
new_pwd->encoding = TLMI_ENCODING_ASCII;
new_pwd->pwd_type = pwd_type;
new_pwd->role = pwd_role;
@@ -1582,7 +1582,7 @@ static int tlmi_analyze(void)
goto fail_clear_attr;
}
setting->index = i;
- strscpy(setting->display_name, item, TLMI_SETTINGS_MAXLEN);
+ strscpy(setting->display_name, item);
/* If BIOS selections supported, load those */
if (tlmi_priv.can_get_bios_selections) {
ret = tlmi_get_bios_selections(setting->display_name,
--
2.45.1
Powered by blists - more mailing lists