]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scripts/kallsyms: remove unneeded length check for prefix matching
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 23 Nov 2019 16:04:34 +0000 (01:04 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 25 Nov 2019 12:03:18 +0000 (21:03 +0900)
l <= strlen(sym_name) is unnecessary for prefix matching.
strncmp() will do.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kallsyms.c

index 14a50c8d3f3400ea1b40b0eaeb7f045b57d2d4da..a57636c6f84fdbd2ebb1b2275e3fe9832c3eb764 100644 (file)
@@ -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;
        }