Skip to content

Commit 76903a9

Browse files
Yonghong Songkees
authored andcommitted
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. Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230825202036.441212-1-yonghong.song@linux.dev Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 33f0467 commit 76903a9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

kernel/kallsyms.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ unsigned long kallsyms_sym_address(int idx)
163163
return kallsyms_relative_base - 1 - kallsyms_offsets[idx];
164164
}
165165

166-
static bool cleanup_symbol_name(char *s)
166+
static void cleanup_symbol_name(char *s)
167167
{
168168
char *res;
169169

170170
if (!IS_ENABLED(CONFIG_LTO_CLANG))
171-
return false;
171+
return;
172172

173173
/*
174174
* LLVM appends various suffixes for local functions and variables that
@@ -178,12 +178,10 @@ static bool cleanup_symbol_name(char *s)
178178
* - foo.llvm.[0-9a-f]+
179179
*/
180180
res = strstr(s, ".llvm.");
181-
if (res) {
181+
if (res)
182182
*res = '\0';
183-
return true;
184-
}
185183

186-
return false;
184+
return;
187185
}
188186

189187
static int compare_symbol_name(const char *name, char *namebuf)

0 commit comments

Comments
 (0)