* [PATCH] kernel/kallsyms: replace all_var with IS_ENABLED(CONFIG_KALLSYMS_ALL)
@ 2017-06-16 1:46 Masahiro Yamada
0 siblings, 0 replies; only message in thread
From: Masahiro Yamada @ 2017-06-16 1:46 UTC (permalink / raw)
To: Andrew Morton
Cc: Masahiro Yamada, Alexei Starovoitov, linux-kernel,
Daniel Borkmann, David S. Miller
The "all_var" looks like a variable, but is actually a macro.
Use IS_ENABLED(CONFIG_KALLSYMS_ALL) for clarification.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
kernel/kallsyms.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 6a3b249a2ae1..127e7cfafa55 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -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.
@@ -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);
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-16 1:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 1:46 [PATCH] kernel/kallsyms: replace all_var with IS_ENABLED(CONFIG_KALLSYMS_ALL) Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).