kallsyms: Change func signature for cleanup_symbol_name()
PATCH 1/1 kallsyms: Change func signature for cleanup_symbol_name()
All users of cleanup_symbol_name() do not use the return value. So let us change the return value of cleanup_symbol_name() to 'void' to reflect its usage pattern.
--- kernel/kallsyms.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
NOTE:
This patch needs to be applied after the following patch:
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id=33f0467fe069
kernel/kallsyms.c +4 -6
@@ -163,12 +163,12 @@ unsigned long kallsyms_sym_address(int idx)return kallsyms_relative_base -1 - kallsyms_offsets[idx]; } -static bool cleanup_symbol_name (char *s) +static void cleanup_symbol_name (char *s) {char *res;if (!IS_ENABLED (CONFIG_LTO_CLANG )) -return false; +return ;/* * LLVM appends various suffixes for local functions and variables that
@@ -178,12 +178,10 @@ static bool cleanup_symbol_name(char *s)* - foo.llvm.[0-9a-f]+ */ res =strstr (s,".llvm." ); -if (res) { +if (res) *res ='\0' ; -return true; - } -return false; +return ; }static int compare_symbol_name (const char *name,char *namebuf)
Signature · 1 line
2.34.1
Quoted 7 lines · Yonghong Song
All users of
cleanup_symbol_name()do not use the return value. So let us change the return value ofcleanup_symbol_name()to 'void' to reflect its usage pattern.Suggested-by Nick Desaulniers <[email protected]>Signed-off-by Yonghong Song <[email protected]>
LGTM; thanks!
Quoted 45 lines
--- kernel/kallsyms.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)NOTE:
This patch needs to be applied after the following patch:
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id=33f0467fe069kernel/kallsyms.c +4
-7@@ -163,12 +163,12 @@ unsigned long kallsyms_sym_address(int idx)return kallsyms_relative_base -1 - kallsyms_offsets[idx]; } -static bool cleanup_symbol_name (char *s) +static void cleanup_symbol_name (char *s) {char *res;if (!IS_ENABLED (CONFIG_LTO_CLANG )) -return false; +return ;/* * LLVM appends various suffixes for local functions and variables that @@ -178,12 +178,10 @@ static bool cleanup_symbol_name(char *s)* - foo.llvm.[0-9a-f]+ */ res =strstr (s,".llvm." ); -if (res) { +if (res) *res ='\0' ; -return true; - } -return false; +return ; }static int compare_symbol_name (const char *name,char *namebuf) --2.34.1
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 7 lines · Yonghong Song
All users of
cleanup_symbol_name()do not use the return value. So let us change the return value ofcleanup_symbol_name()to 'void' to reflect its usage pattern.Suggested-by Nick Desaulniers <[email protected]>Signed-off-by Yonghong Song <[email protected]>
Kees Cook
AppliedQuoted 5 lines · Yonghong Song
All users of
cleanup_symbol_name()do not use the return value. So let us change the return value ofcleanup_symbol_name()to 'void' to reflect its usage pattern.
Applied to for-next/hardening, thanks!
[1/1] kallsyms: Change func signature for cleanup_symbol_name()
https://git.kernel.org/kees/c/76903a964874
Take care,
Signature · 1 line
Kees Cook