* [PATCH] platform/x86: think-lmi: Use ARRAY_SIZE() in tlmi_errstr_to_err()
@ 2026-08-15 9:34 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-08-15 9:34 UTC (permalink / raw)
To: Mark Pearson, Derek J. Clark, Hans de Goede, Ilpo Järvinen
Cc: Thorsten Blum, platform-driver-x86, linux-kernel
Use the ARRAY_SIZE() helper to simplify tlmi_errstr_to_err().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/platform/x86/lenovo/think-lmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index 26ee6ab34a15..81ab6aafee47 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -249,7 +249,7 @@ static int tlmi_errstr_to_err(const char *errstr)
{
int i;
- for (i = 0; i < sizeof(tlmi_errs)/sizeof(struct tlmi_err_codes); i++) {
+ for (i = 0; i < ARRAY_SIZE(tlmi_errs); i++) {
if (!strcmp(tlmi_errs[i].err_str, errstr))
return tlmi_errs[i].err_code;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-15 9:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-15 9:34 [PATCH] platform/x86: think-lmi: Use ARRAY_SIZE() in tlmi_errstr_to_err() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®