mm: Apply the section attribute to the variable, not its type
PATCH 1/1 mm: Apply the section attribute to the variable, not its type
From: Jan-Simon Möller <[email protected]>
This fixes a compilation error in clang in that a linker section attribute can't be added to a type.
arch/x86/mm/mmap.c:34:8: error: '__section__' attribute only applies to functions and global variables
struct __read_mostly va_alignment va_align = {
^
arch/x86/include/asm/cache.h:10:38: note: expanded from macro '__read_mostly'
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
^1 error generated.
By moving the section attribute to the variable declaration, the desired effect is acheived.
--- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/mmap.c +1 -1
@@ -31,7 +31,7 @@#include <linux/sched.h> #include <asm/elf.h> -struct __read_mostly va_alignment va_align = { +struct va_alignment __read_mostly va_align = { .flags =-1 , };
Signature · 1 line
1.9.1
tip-bot for Jan-Simon Möller
merge bot[tip:x86/urgent] x86/mm: Apply the section attribute to the variable, not its type
x86/mm: Apply the section attribute to the variable, not its type
Commit-ID: cc99535eb4049c730cac421d403d079593cb31ae Gitweb: http://git.kernel.org/tip/cc99535eb4049c730cac421d403d079593cb31ae Author: Jan-Simon Möller <[email protected]> AuthorDate: Fri, 5 Sep 2014 16:16:45 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 9 Sep 2014 07:13:39 +0200
x86/mm: Apply the section attribute to the variable, not its type
This fixes a compilation error in clang in that a linker section attribute can't be added to a type:
arch/x86/mm/mmap.c:34:8: error: '__section__' attribute only applies to functions and global variables struct __read_mostly
...
By moving the section attribute to the variable declaration, the desired effect is achieved.
--- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/mmap.c +1 -1
@@ -31,7 +31,7 @@#include <linux/sched.h> #include <asm/elf.h> -struct __read_mostly va_alignment va_align = { +struct va_alignment __read_mostly va_align = { .flags =-1 , };