Skip to content

Commit

Permalink
kernel/kallsyms.c: replace all_var with IS_ENABLED(CONFIG_KALLSYMS_ALL)
Browse files Browse the repository at this point in the history
'all_var' looks like a variable, but is actually a macro.  Use
IS_ENABLED(CONFIG_KALLSYMS_ALL) for clarification.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
masahir0y authored and torvalds committed Jul 10, 2017
1 parent b7b2562 commit 63b23e2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions kernel/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@

#include <asm/sections.h>

#ifdef CONFIG_KALLSYMS_ALL
#define all_var 1
#else
#define all_var 0
#endif

/*
* These will be re-linked against their real values
* during the second link stage.
Expand Down Expand Up @@ -82,7 +76,7 @@ static inline int is_kernel(unsigned long addr)

static int is_ksym_addr(unsigned long addr)
{
if (all_var)
if (IS_ENABLED(CONFIG_KALLSYMS_ALL))
return is_kernel(addr);

return is_kernel_text(addr) || is_kernel_inittext(addr);
Expand Down Expand Up @@ -280,7 +274,7 @@ static unsigned long get_symbol_pos(unsigned long addr,
if (!symbol_end) {
if (is_kernel_inittext(addr))
symbol_end = (unsigned long)_einittext;
else if (all_var)
else if (IS_ENABLED(CONFIG_KALLSYMS_ALL))
symbol_end = (unsigned long)_end;
else
symbol_end = (unsigned long)_etext;
Expand Down

0 comments on commit 63b23e2

Please sign in to comment.