Skip to content

Commit 33def84

Browse files
JoePerchestorvalds
authored andcommitted
treewide: Convert macro and uses of __section(foo) to __section("foo")
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. Conversion done using the script at: https://lore.kernel.org/lkml/[email protected]/2-convert_section.pl Signed-off-by: Joe Perches <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 986b9ea commit 33def84

File tree

117 files changed

+196
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+196
-196
lines changed

arch/arc/include/asm/linkage.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@
6464
#else /* !__ASSEMBLY__ */
6565

6666
#ifdef CONFIG_ARC_HAS_ICCM
67-
#define __arcfp_code __section(.text.arcfp)
67+
#define __arcfp_code __section(".text.arcfp")
6868
#else
69-
#define __arcfp_code __section(.text)
69+
#define __arcfp_code __section(".text")
7070
#endif
7171

7272
#ifdef CONFIG_ARC_HAS_DCCM
73-
#define __arcfp_data __section(.data.arcfp)
73+
#define __arcfp_data __section(".data.arcfp")
7474
#else
75-
#define __arcfp_data __section(.data)
75+
#define __arcfp_data __section(".data")
7676
#endif
7777

7878
#endif /* __ASSEMBLY__ */

arch/arc/include/asm/mach_desc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
5353
*/
5454
#define MACHINE_START(_type, _name) \
5555
static const struct machine_desc __mach_desc_##_type \
56-
__used __section(.arch.info.init) = { \
56+
__used __section(".arch.info.init") = { \
5757
.name = _name,
5858

5959
#define MACHINE_END \

arch/arc/plat-hsdk/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <asm/io.h>
1414
#include <asm/mach_desc.h>
1515

16-
int arc_hsdk_axi_dmac_coherent __section(.data) = 0;
16+
int arc_hsdk_axi_dmac_coherent __section(".data") = 0;
1717

1818
#define ARC_CCM_UNUSED_ADDR 0x60000000
1919

arch/arm/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#define ARCH_SLAB_MINALIGN 8
2525
#endif
2626

27-
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
27+
#define __read_mostly __section(".data..read_mostly")
2828

2929
#endif

arch/arm/include/asm/cpuidle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct of_cpuidle_method {
4242

4343
#define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops) \
4444
static const struct of_cpuidle_method __cpuidle_method_of_table_##name \
45-
__used __section(__cpuidle_method_of_table) \
45+
__used __section("__cpuidle_method_of_table") \
4646
= { .method = _method, .ops = _ops }
4747

4848
extern int arm_cpuidle_suspend(int index);

arch/arm/include/asm/idmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <linux/pgtable.h>
77

88
/* Tag a function as requiring to be executed via an identity mapping. */
9-
#define __idmap __section(.idmap.text) noinline notrace
9+
#define __idmap __section(".idmap.text") noinline notrace
1010

1111
extern pgd_t *idmap_pgd;
1212

arch/arm/include/asm/mach/arch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
8181
#define MACHINE_START(_type,_name) \
8282
static const struct machine_desc __mach_desc_##_type \
8383
__used \
84-
__attribute__((__section__(".arch.info.init"))) = { \
84+
__section(".arch.info.init") = { \
8585
.nr = MACH_TYPE_##_type, \
8686
.name = _name,
8787

@@ -91,7 +91,7 @@ static const struct machine_desc __mach_desc_##_type \
9191
#define DT_MACHINE_START(_name, _namestr) \
9292
static const struct machine_desc __mach_desc_##_name \
9393
__used \
94-
__attribute__((__section__(".arch.info.init"))) = { \
94+
__section(".arch.info.init") = { \
9595
.nr = ~0, \
9696
.name = _namestr,
9797

arch/arm/include/asm/setup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <uapi/asm/setup.h>
1515

1616

17-
#define __tag __used __attribute__((__section__(".taglist.init")))
17+
#define __tag __used __section(".taglist.init")
1818
#define __tagtable(tag, fn) \
1919
static const struct tagtable __tagtable_##fn __tag = { tag, fn }
2020

arch/arm/include/asm/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct of_cpu_method {
112112

113113
#define CPU_METHOD_OF_DECLARE(name, _method, _ops) \
114114
static const struct of_cpu_method __cpu_method_of_table_##name \
115-
__used __section(__cpu_method_of_table) \
115+
__used __section("__cpu_method_of_table") \
116116
= { .method = _method, .ops = _ops }
117117
/*
118118
* set platform specific SMP operations

arch/arm/include/asm/tcm.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
#include <linux/compiler.h>
1717

1818
/* Tag variables with this */
19-
#define __tcmdata __section(.tcm.data)
19+
#define __tcmdata __section(".tcm.data")
2020
/* Tag constants with this */
21-
#define __tcmconst __section(.tcm.rodata)
21+
#define __tcmconst __section(".tcm.rodata")
2222
/* Tag functions inside TCM called from outside TCM with this */
23-
#define __tcmfunc __attribute__((long_call)) __section(.tcm.text) noinline
23+
#define __tcmfunc __attribute__((long_call)) __section(".tcm.text") noinline
2424
/* Tag function inside TCM called from inside TCM with this */
25-
#define __tcmlocalfunc __section(.tcm.text)
25+
#define __tcmlocalfunc __section(".tcm.text")
2626

2727
void *tcm_alloc(size_t len);
2828
void tcm_free(void *addr, size_t len);

arch/arm/kernel/cpuidle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
extern struct of_cpuidle_method __cpuidle_method_of_table[];
1212

1313
static const struct of_cpuidle_method __cpuidle_method_of_table_sentinel
14-
__used __section(__cpuidle_method_of_table_end);
14+
__used __section("__cpuidle_method_of_table_end");
1515

1616
static struct cpuidle_ops cpuidle_ops[NR_CPUS] __ro_after_init;
1717

arch/arm/kernel/devtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
extern struct of_cpu_method __cpu_method_of_table[];
3030

3131
static const struct of_cpu_method __cpu_method_of_table_sentinel
32-
__used __section(__cpu_method_of_table_end);
32+
__used __section("__cpu_method_of_table_end");
3333

3434

3535
static int __init set_smp_ops_by_method(struct device_node *node)

arch/arm64/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static inline u32 cache_type_cwg(void)
7979
return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;
8080
}
8181

82-
#define __read_mostly __section(.data..read_mostly)
82+
#define __read_mostly __section(".data..read_mostly")
8383

8484
static inline int cache_line_size_of_cpu(void)
8585
{

arch/arm64/kernel/efi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md)
5454
}
5555

5656
/* we will fill this structure from the stub, so don't put it in .bss */
57-
struct screen_info screen_info __section(.data);
57+
struct screen_info screen_info __section(".data");
5858

5959
int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md)
6060
{

arch/arm64/kernel/smp_spin_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <asm/smp_plat.h>
2020

2121
extern void secondary_holding_pen(void);
22-
volatile unsigned long __section(.mmuoff.data.read)
22+
volatile unsigned long __section(".mmuoff.data.read")
2323
secondary_holding_pen_release = INVALID_HWID;
2424

2525
static phys_addr_t cpu_release_addr[NR_CPUS];

arch/arm64/mm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
4444
u64 idmap_ptrs_per_pgd = PTRS_PER_PGD;
4545

46-
u64 __section(.mmuoff.data.write) vabits_actual;
46+
u64 __section(".mmuoff.data.write") vabits_actual;
4747
EXPORT_SYMBOL(vabits_actual);
4848

4949
u64 kimage_voffset __ro_after_init;

arch/csky/include/asm/tcm.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
#include <linux/compiler.h>
1111

1212
/* Tag variables with this */
13-
#define __tcmdata __section(.tcm.data)
13+
#define __tcmdata __section(".tcm.data")
1414
/* Tag constants with this */
15-
#define __tcmconst __section(.tcm.rodata)
15+
#define __tcmconst __section(".tcm.rodata")
1616
/* Tag functions inside TCM called from outside TCM with this */
17-
#define __tcmfunc __section(.tcm.text) noinline
17+
#define __tcmfunc __section(".tcm.text") noinline
1818
/* Tag function inside TCM called from inside TCM with this */
19-
#define __tcmlocalfunc __section(.tcm.text)
19+
#define __tcmlocalfunc __section(".tcm.text")
2020

2121
void *tcm_alloc(size_t len);
2222
void tcm_free(void *addr, size_t len);

arch/ia64/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
# define SMP_CACHE_BYTES (1 << 3)
2626
#endif
2727

28-
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
28+
#define __read_mostly __section(".data..read_mostly")
2929

3030
#endif /* _ASM_IA64_CACHE_H */

arch/microblaze/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ DEFINE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
4646
* ASM code. Default position is BSS section which is cleared
4747
* in machine_early_init().
4848
*/
49-
char cmd_line[COMMAND_LINE_SIZE] __attribute__ ((section(".data")));
49+
char cmd_line[COMMAND_LINE_SIZE] __section(".data");
5050

5151
void __init setup_arch(char **cmdline_p)
5252
{

arch/mips/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
1515
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
1616

17-
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
17+
#define __read_mostly __section(".data..read_mostly")
1818

1919
#endif /* _ASM_CACHE_H */

arch/mips/include/asm/machine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern long __mips_machines_end;
2323

2424
#define MIPS_MACHINE(name) \
2525
static const struct mips_machine __mips_mach_##name \
26-
__used __section(.mips.machines.init)
26+
__used __section(".mips.machines.init")
2727

2828
#define for_each_mips_machine(mach) \
2929
for ((mach) = (struct mips_machine *)&__mips_machines_start; \

arch/mips/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include <asm/prom.h>
4545

4646
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
47-
const char __section(.appended_dtb) __appended_dtb[0x100000];
47+
const char __section(".appended_dtb") __appended_dtb[0x100000];
4848
#endif /* CONFIG_MIPS_ELF_APPENDED_DTB */
4949

5050
struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;

arch/mips/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ unsigned long pgd_current[NR_CPUS];
569569
* size, and waste space. So we place it in its own section and align
570570
* it in the linker script.
571571
*/
572-
pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
572+
pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(".bss..swapper_pg_dir");
573573
#ifndef __PAGETABLE_PUD_FOLDED
574574
pud_t invalid_pud_table[PTRS_PER_PUD] __page_aligned_bss;
575575
#endif

arch/parisc/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
2424

25-
#define __read_mostly __section(.data..read_mostly)
25+
#define __read_mostly __section(".data..read_mostly")
2626

2727
void parisc_cache_init(void); /* initializes cache-flushing */
2828
void disable_sr_hashing_asm(int); /* low level support for above */

arch/parisc/include/asm/ldcw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
})
5353

5454
#ifdef CONFIG_SMP
55-
# define __lock_aligned __section(.data..lock_aligned)
55+
# define __lock_aligned __section(".data..lock_aligned")
5656
#endif
5757

5858
#endif /* __PARISC_LDCW_H */

arch/parisc/kernel/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <asm/ftrace.h>
2222
#include <asm/patch.h>
2323

24-
#define __hot __attribute__ ((__section__ (".text.hot")))
24+
#define __hot __section(".text.hot")
2525

2626
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
2727
/*

arch/parisc/mm/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ extern void parisc_kernel_start(void); /* Kernel entry point in head.S */
4242
* guarantee that global objects will be laid out in memory in the same order
4343
* as the order of declaration, so put these in different sections and use
4444
* the linker script to order them. */
45-
pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data..vm0.pmd"), aligned(PAGE_SIZE)));
45+
pmd_t pmd0[PTRS_PER_PMD] __section(".data..vm0.pmd") __attribute__ ((aligned(PAGE_SIZE)));
4646
#endif
4747

48-
pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data..vm0.pgd"), aligned(PAGE_SIZE)));
49-
pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data..vm0.pte"), aligned(PAGE_SIZE)));
48+
pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(".data..vm0.pgd") __attribute__ ((aligned(PAGE_SIZE)));
49+
pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __section(".data..vm0.pte") __attribute__ ((aligned(PAGE_SIZE)));
5050

5151
static struct resource data_resource = {
5252
.name = "Kernel data",

arch/powerpc/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline u32 l1_icache_bytes(void)
9797

9898
#endif
9999

100-
#define __read_mostly __section(.data..read_mostly)
100+
#define __read_mostly __section(".data..read_mostly")
101101

102102
#ifdef CONFIG_PPC_BOOK3S_32
103103
extern long _get_L2CR(void);

arch/powerpc/include/asm/machdep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ extern void book3e_idle(void);
232232
extern struct machdep_calls ppc_md;
233233
extern struct machdep_calls *machine_id;
234234

235-
#define __machine_desc __attribute__ ((__section__ (".machine.desc")))
235+
#define __machine_desc __section(".machine.desc")
236236

237237
#define define_machine(name) \
238238
extern struct machdep_calls mach_##name; \

arch/powerpc/kernel/btext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
static void scrollscreen(void);
2727
#endif
2828

29-
#define __force_data __section(.data)
29+
#define __force_data __section(".data")
3030

3131
static int g_loc_X __force_data;
3232
static int g_loc_Y __force_data;

arch/powerpc/kernel/prom_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <linux/linux_logo.h>
4646

4747
/* All of prom_init bss lives here */
48-
#define __prombss __section(.bss.prominit)
48+
#define __prombss __section(".bss.prominit")
4949

5050
/*
5151
* Eventually bump that one up

arch/powerpc/kvm/book3s_64_vio_hv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#ifdef CONFIG_BUG
3333

3434
#define WARN_ON_ONCE_RM(condition) ({ \
35-
static bool __section(.data.unlikely) __warned; \
35+
static bool __section(".data.unlikely") __warned; \
3636
int __ret_warn_once = !!(condition); \
3737
\
3838
if (unlikely(__ret_warn_once && !__warned)) { \

arch/riscv/include/asm/soc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#define SOC_EARLY_INIT_DECLARE(name, compat, fn) \
1515
static const struct of_device_id __soc_early_init__##name \
16-
__used __section(__soc_early_init_table) \
16+
__used __section("__soc_early_init_table") \
1717
= { .compatible = compat, .data = fn }
1818

1919
void soc_early_init(void);
@@ -46,7 +46,7 @@ struct soc_builtin_dtb {
4646
} \
4747
\
4848
static const struct soc_builtin_dtb __soc_builtin_dtb__##name \
49-
__used __section(__soc_builtin_dtb_table) = \
49+
__used __section("__soc_builtin_dtb_table") = \
5050
{ \
5151
.vendor_id = vendor, \
5252
.arch_id = arch, \

arch/riscv/kernel/cpu_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
1717

18-
void *__cpu_up_stack_pointer[NR_CPUS] __section(.data);
19-
void *__cpu_up_task_pointer[NR_CPUS] __section(.data);
18+
void *__cpu_up_stack_pointer[NR_CPUS] __section(".data");
19+
void *__cpu_up_task_pointer[NR_CPUS] __section(".data");
2020

2121
extern const struct cpu_operations cpu_ops_sbi;
2222
extern const struct cpu_operations cpu_ops_spinwait;

arch/riscv/kernel/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "head.h"
3333

3434
#if defined(CONFIG_DUMMY_CONSOLE) || defined(CONFIG_EFI)
35-
struct screen_info screen_info __section(.data) = {
35+
struct screen_info screen_info __section(".data") = {
3636
.orig_video_lines = 30,
3737
.orig_video_cols = 80,
3838
.orig_video_mode = 0,
@@ -47,7 +47,7 @@ struct screen_info screen_info __section(.data) = {
4747
* This is used before the kernel initializes the BSS so it can't be in the
4848
* BSS.
4949
*/
50-
atomic_t hart_lottery __section(.sdata);
50+
atomic_t hart_lottery __section(".sdata");
5151
unsigned long boot_cpu_hartid;
5252
static DEFINE_PER_CPU(struct cpu, cpu_devices);
5353

arch/s390/boot/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct diag_ops __bootdata_preserved(diag_dma_ops) = {
4646
.diag0c = _diag0c_dma,
4747
.diag308_reset = _diag308_reset_dma
4848
};
49-
static struct diag210 _diag210_tmp_dma __section(.dma.data);
49+
static struct diag210 _diag210_tmp_dma __section(".dma.data");
5050
struct diag210 *__bootdata_preserved(__diag210_tmp_dma) = &_diag210_tmp_dma;
5151

5252
void error(char *x)

arch/s390/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
#define L1_CACHE_SHIFT 8
1515
#define NET_SKB_PAD 32
1616

17-
#define __read_mostly __section(.data..read_mostly)
17+
#define __read_mostly __section(".data..read_mostly")
1818

1919
#endif

0 commit comments

Comments
 (0)