提交 c5e5002f 编写于 作者: M Masahiro Yamada

scripts/kallsyms: remove unneeded length check for prefix matching

l <= strlen(sym_name) is unnecessary for prefix matching.
strncmp() will do.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 e0109042
...@@ -246,8 +246,7 @@ static int symbol_valid(struct sym_entry *s) ...@@ -246,8 +246,7 @@ static int symbol_valid(struct sym_entry *s)
for (i = 0; special_prefixes[i]; i++) { for (i = 0; special_prefixes[i]; i++) {
int l = strlen(special_prefixes[i]); int l = strlen(special_prefixes[i]);
if (l <= strlen(sym_name) && if (strncmp(sym_name, special_prefixes[i], l) == 0)
strncmp(sym_name, special_prefixes[i], l) == 0)
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册