treewide: Convert macro and uses of __section(foo) to __section("foo")
This commit does the same thing as Linux commit 33def8498fdd.
Use a more generic form for __section that requires quotes to avoid
complications with clang and gcc differences.
Remove the quote operator # from compiler_attributes.h __section macro.
Convert all unquoted __section(foo) uses to quoted __section("foo").
Also convert __attribute__((section("foo"))) uses to __section("foo")
even if the __attribute__ has multiple list entry forms.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/include/efi_loader.h b/include/efi_loader.h
index de1a496..ce9b238 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -682,8 +682,8 @@
* Use these to indicate that your code / data should go into the EFI runtime
* section and thus still be available when the OS is running
*/
-#define __efi_runtime_data __attribute__ ((section (".data.efi_runtime")))
-#define __efi_runtime __attribute__ ((section (".text.efi_runtime")))
+#define __efi_runtime_data __section(".data.efi_runtime")
+#define __efi_runtime __section(".text.efi_runtime")
/* Indicate supported runtime services */
efi_status_t efi_init_runtime_supported(void);
diff --git a/include/linker_lists.h b/include/linker_lists.h
index 2fea54c..0575164 100644
--- a/include/linker_lists.h
+++ b/include/linker_lists.h
@@ -69,8 +69,8 @@
*/
#define ll_entry_declare(_type, _name, _list) \
_type _u_boot_list_2_##_list##_2_##_name __aligned(4) \
- __attribute__((unused, \
- section(".u_boot_list_2_"#_list"_2_"#_name)))
+ __attribute__((unused)) \
+ __section(".u_boot_list_2_"#_list"_2_"#_name)
/**
* ll_entry_declare_list() - Declare a list of link-generated array entries
@@ -92,8 +92,8 @@
*/
#define ll_entry_declare_list(_type, _name, _list) \
_type _u_boot_list_2_##_list##_2_##_name[] __aligned(4) \
- __attribute__((unused, \
- section(".u_boot_list_2_"#_list"_2_"#_name)))
+ __attribute__((unused)) \
+ __section(".u_boot_list_2_"#_list"_2_"#_name)
/*
* We need a 0-byte-size type for iterator symbols, and the compiler
@@ -125,8 +125,8 @@
#define ll_entry_start(_type, _list) \
({ \
static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN) \
- __attribute__((unused, \
- section(".u_boot_list_2_"#_list"_1"))); \
+ __attribute__((unused)) \
+ __section(".u_boot_list_2_"#_list"_1"); \
(_type *)&start; \
})
@@ -151,8 +151,8 @@
*/
#define ll_entry_end(_type, _list) \
({ \
- static char end[0] __aligned(4) __attribute__((unused, \
- section(".u_boot_list_2_"#_list"_3"))); \
+ static char end[0] __aligned(4) __attribute__((unused)) \
+ __section(".u_boot_list_2_"#_list"_3"); \
(_type *)&end; \
})
/**
@@ -245,8 +245,8 @@
*/
#define ll_start(_type) \
({ \
- static char start[0] __aligned(4) __attribute__((unused, \
- section(".u_boot_list_1"))); \
+ static char start[0] __aligned(4) __attribute__((unused)) \
+ __section(".u_boot_list_1"); \
(_type *)&start; \
})
@@ -268,8 +268,8 @@
*/
#define ll_end(_type) \
({ \
- static char end[0] __aligned(4) __attribute__((unused, \
- section(".u_boot_list_3"))); \
+ static char end[0] __aligned(4) __attribute__((unused)) \
+ __section(".u_boot_list_3"); \
(_type *)&end; \
})
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5e3b3c0..82a8a4e 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -24,7 +24,7 @@
long ______r; \
static struct ftrace_likely_data \
__aligned(4) \
- __section(_ftrace_annotated_branch) \
+ __section("_ftrace_annotated_branch") \
______f = { \
.data.func = __func__, \
.data.file = __FILE__, \
@@ -60,7 +60,7 @@
#define __trace_if_value(cond) ({ \
static struct ftrace_branch_data \
__aligned(4) \
- __section(_ftrace_branch) \
+ __section("_ftrace_branch") \
__if_trace = { \
.func = __func__, \
.file = __FILE__, \
@@ -118,7 +118,7 @@
".popsection\n\t"
/* Annotate a C jump table to allow objtool to follow the code flow */
-#define __annotate_jump_table __section(.rodata..c_jump_table)
+#define __annotate_jump_table __section(".rodata..c_jump_table")
#else
#define annotate_reachable()
@@ -294,7 +294,7 @@
* visible to the compiler.
*/
#define __ADDRESSABLE(sym) \
- static void * __section(.discard.addressable) __used \
+ static void * __section(".discard.addressable") __used \
__PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
/**
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index cdf0165..44c9a08 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -246,7 +246,7 @@
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
* clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
*/
-#define __section(S) __attribute__((__section__(#S)))
+#define __section(S) __attribute__((__section__(S)))
/*
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute