[PATCH] platform/x86: think-lmi: Use ARRAY_SIZE() in tlmi_errstr_to_err()
From: Thorsten Blum
Date: Sat Aug 15 2026 - 05:36:00 EST
Use the ARRAY_SIZE() helper to simplify tlmi_errstr_to_err().
Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
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;
}