l <= strlen(sym_name) is unnecessary for prefix matching.
strncmp() will do.
Signed-off-by: Masahiro Yamada <[email protected]>
---
scripts/kallsyms.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 265475d3cffb..d06f373b3a96 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -246,8 +246,7 @@ static int symbol_valid(struct sym_entry *s)
for (i = 0; special_prefixes[i]; i++) {
int l = strlen(special_prefixes[i]);
- if (l <= strlen(sym_name) &&
- strncmp(sym_name, special_prefixes[i], l) == 0)
+ if (strncmp(sym_name, special_prefixes[i], l) == 0)
return 0;
}
--
2.17.1