arm64: prefer __section from compiler_attributes.h
authorNick Desaulniers <ndesaulniers@google.com>
Mon, 12 Aug 2019 21:50:45 +0000 (14:50 -0700)
committerWill Deacon <will@kernel.org>
Tue, 13 Aug 2019 17:32:15 +0000 (18:32 +0100)
GCC unescapes escaped string section names while Clang does not. Because
__section uses the `#` stringification operator for the section name, it
doesn't need to be escaped.

This antipattern was found with:
$ grep -e __section\(\" -e __section__\(\" -r

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/cache.h
arch/arm64/kernel/smp_spin_table.c

index 64eeaa41e7caa2c76083ffdafd993abc7df17f4f..43da6dd295920798debddb2854563a909ba5e19b 100644 (file)
@@ -78,7 +78,7 @@ static inline u32 cache_type_cwg(void)
        return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;
 }
 
-#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+#define __read_mostly __section(.data..read_mostly)
 
 static inline int cache_line_size_of_cpu(void)
 {
index 76c2739ba8a483c8a77ba4ae9d1ed25cc7caf6ca..c8a3fee00c11329910ae63f6fe3ac98e0fd60fdb 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/smp_plat.h>
 
 extern void secondary_holding_pen(void);
-volatile unsigned long __section(".mmuoff.data.read")
+volatile unsigned long __section(.mmuoff.data.read)
 secondary_holding_pen_release = INVALID_HWID;
 
 static phys_addr_t cpu_release_addr[NR_CPUS];