[PATCH bpf-next 01/11] btf: Fix BTF_SET_START_GLOBAL macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The extern symbol declaration should be on the BTF_SET_START macro, not
on BTF_SET_START_GLOBAL, since in the global case the symbol will be
declared in a header somewhere.

Fixes: eae2e83e6263 ("bpf: Add BTF_SET_START/END macros")
Signed-off-by: Lorenz Bauer <lmb@xxxxxxxxxxxxxx>
---
 include/linux/btf_ids.h       | 6 +++---
 tools/include/linux/btf_ids.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index 210b086188a3..42aa667d4433 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -121,7 +121,8 @@ asm(							\
 
 #define BTF_SET_START(name)				\
 __BTF_ID_LIST(name, local)				\
-__BTF_SET_START(name, local)
+__BTF_SET_START(name, local)				\
+extern struct btf_id_set name;
 
 #define BTF_SET_START_GLOBAL(name)			\
 __BTF_ID_LIST(name, globl)				\
@@ -131,8 +132,7 @@ __BTF_SET_START(name, globl)
 asm(							\
 ".pushsection " BTF_IDS_SECTION ",\"a\";      \n"	\
 ".size __BTF_ID__set__" #name ", .-" #name "  \n"	\
-".popsection;                                 \n");	\
-extern struct btf_id_set name;
+".popsection;                                 \n");
 
 #else
 
diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
index 210b086188a3..42aa667d4433 100644
--- a/tools/include/linux/btf_ids.h
+++ b/tools/include/linux/btf_ids.h
@@ -121,7 +121,8 @@ asm(							\
 
 #define BTF_SET_START(name)				\
 __BTF_ID_LIST(name, local)				\
-__BTF_SET_START(name, local)
+__BTF_SET_START(name, local)				\
+extern struct btf_id_set name;
 
 #define BTF_SET_START_GLOBAL(name)			\
 __BTF_ID_LIST(name, globl)				\
@@ -131,8 +132,7 @@ __BTF_SET_START(name, globl)
 asm(							\
 ".pushsection " BTF_IDS_SECTION ",\"a\";      \n"	\
 ".size __BTF_ID__set__" #name ", .-" #name "  \n"	\
-".popsection;                                 \n");	\
-extern struct btf_id_set name;
+".popsection;                                 \n");
 
 #else
 
-- 
2.25.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux