[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241119235705.1576946-2-masahiroy@kernel.org>
Date: Wed, 20 Nov 2024 08:56:40 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>,
linux-kernel@...r.kernel.org
Subject: [PATCH 02/15] modpost: remove unnecessary check in do_acpi_entry()
The 'id' pointer is never NULL since it has the same address as
'symval'.
Also, checking (*id)[0] is simpler than calling strlen().
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---
scripts/mod/file2alias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 634e40748287..34678ed40fdb 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -570,7 +570,7 @@ static int do_acpi_entry(const char *filename,
DEF_FIELD(symval, acpi_device_id, cls);
DEF_FIELD(symval, acpi_device_id, cls_msk);
- if (id && strlen((const char *)*id))
+ if ((*id)[0])
sprintf(alias, "acpi*:%s:*", *id);
else {
int i, byte_shift, cnt = 0;
--
2.43.0
Powered by blists - more mailing lists