提交 b3e089cd 编写于 作者: C Chuhong Yuan 提交者: Will Deacon

arm64: Replace strncmp with str_has_prefix

In commit b6b27355
("tracing: Use str_has_prefix() instead of using fixed sizes")
the newly introduced str_has_prefix() was used
to replace error-prone strncmp(str, const, len).
Here fix codes with the same pattern.
Signed-off-by: NChuhong Yuan <hslester96@gmail.com>
Signed-off-by: NWill Deacon <will@kernel.org>
上级 3e77eeb7
...@@ -302,7 +302,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, ...@@ -302,7 +302,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
/* sort by type, symbol index and addend */ /* sort by type, symbol index and addend */
sort(rels, numrels, sizeof(Elf64_Rela), cmp_rela, NULL); sort(rels, numrels, sizeof(Elf64_Rela), cmp_rela, NULL);
if (strncmp(secstrings + dstsec->sh_name, ".init", 5) != 0) if (!str_has_prefix(secstrings + dstsec->sh_name, ".init"))
core_plts += count_plts(syms, rels, numrels, core_plts += count_plts(syms, rels, numrels,
sechdrs[i].sh_info, dstsec); sechdrs[i].sh_info, dstsec);
else else
......
...@@ -29,7 +29,7 @@ static __init int numa_parse_early_param(char *opt) ...@@ -29,7 +29,7 @@ static __init int numa_parse_early_param(char *opt)
{ {
if (!opt) if (!opt)
return -EINVAL; return -EINVAL;
if (!strncmp(opt, "off", 3)) if (str_has_prefix(opt, "off"))
numa_off = true; numa_off = true;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册