summaryrefslogtreecommitdiff
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2020-08-18 15:57:40 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:04 +0200
commit563a02b0c9704f69c0364befedd451f57fe88092 (patch)
treefdcbe3a4b47af0b9f3ded278215bb1fbea25c617 /include/linux/compiler.h
parent0db6e3734b130207026df1e78455fa98ca1d6f50 (diff)
compiler.h: Make __ADDRESSABLE() symbol truly unique
The __ADDRESSABLE() macro uses the __LINE__ macro to create a temporary symbol which has a unique name. However, if the macro is used multiple times from within another macro, the line number will always be the same, resulting in duplicate symbols. Make the temporary symbols truly unique by using __UNIQUE_ID instead of __LINE__. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Link: https://lore.kernel.org/r/20200818135804.564436253@infradead.org
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6810d80acb0b..92ef163a7479 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -207,7 +207,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
*/
#define __ADDRESSABLE(sym) \
static void * __section(.discard.addressable) __used \
- __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
+ __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)&sym;
/**
* offset_to_ptr - convert a relative memory offset to an absolute pointer