diff options
author | Gideon Israel Dsouza <gidisrael@gmail.com> | 2014-04-07 18:37:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:35:54 -0400 |
commit | 3b32123d734cb414e366b35a3b2142a995f9d1a0 (patch) | |
tree | fd9790206b59cd053bf72132da9a70ce3d8a21e5 /mm | |
parent | 615d6e8756c87149f2d4c1b93d471bca002bd849 (diff) |
mm: use macros from compiler.h instead of __attribute__((...))
To increase compiler portability there is <linux/compiler.h> which
provides convenience macros for various gcc constructs. Eg: __weak for
__attribute__((weak)). I've replaced all instances of gcc attributes with
the right macro in the memory management (/mm) subsystem.
[akpm@linux-foundation.org: while-we're-there consistency tweaks]
Signed-off-by: Gideon Israel Dsouza <gidisrael@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 3 | ||||
-rw-r--r-- | mm/nommu.c | 3 | ||||
-rw-r--r-- | mm/sparse.c | 4 | ||||
-rw-r--r-- | mm/util.c | 5 | ||||
-rw-r--r-- | mm/vmalloc.c | 4 |
5 files changed, 13 insertions, 6 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ed5072c64daa..c5aa43993364 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
15 | #include <linux/mempolicy.h> | 15 | #include <linux/mempolicy.h> |
16 | #include <linux/compiler.h> | ||
16 | #include <linux/cpuset.h> | 17 | #include <linux/cpuset.h> |
17 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
18 | #include <linux/bootmem.h> | 19 | #include <linux/bootmem.h> |
@@ -3521,7 +3522,7 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address, | |||
3521 | #else /* !CONFIG_ARCH_WANT_GENERAL_HUGETLB */ | 3522 | #else /* !CONFIG_ARCH_WANT_GENERAL_HUGETLB */ |
3522 | 3523 | ||
3523 | /* Can be overriden by architectures */ | 3524 | /* Can be overriden by architectures */ |
3524 | __attribute__((weak)) struct page * | 3525 | struct page * __weak |
3525 | follow_huge_pud(struct mm_struct *mm, unsigned long address, | 3526 | follow_huge_pud(struct mm_struct *mm, unsigned long address, |
3526 | pud_t *pud, int write) | 3527 | pud_t *pud, int write) |
3527 | { | 3528 | { |
diff --git a/mm/nommu.c b/mm/nommu.c index 5d3f3524bbdc..e68deff6d447 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/vmalloc.h> | 25 | #include <linux/vmalloc.h> |
26 | #include <linux/blkdev.h> | 26 | #include <linux/blkdev.h> |
27 | #include <linux/backing-dev.h> | 27 | #include <linux/backing-dev.h> |
28 | #include <linux/compiler.h> | ||
28 | #include <linux/mount.h> | 29 | #include <linux/mount.h> |
29 | #include <linux/personality.h> | 30 | #include <linux/personality.h> |
30 | #include <linux/security.h> | 31 | #include <linux/security.h> |
@@ -460,7 +461,7 @@ EXPORT_SYMBOL_GPL(vm_unmap_aliases); | |||
460 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to | 461 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to |
461 | * have one. | 462 | * have one. |
462 | */ | 463 | */ |
463 | void __attribute__((weak)) vmalloc_sync_all(void) | 464 | void __weak vmalloc_sync_all(void) |
464 | { | 465 | { |
465 | } | 466 | } |
466 | 467 | ||
diff --git a/mm/sparse.c b/mm/sparse.c index 38cad8fd7397..d1b48b691ac8 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -5,10 +5,12 @@ | |||
5 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
6 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
7 | #include <linux/bootmem.h> | 7 | #include <linux/bootmem.h> |
8 | #include <linux/compiler.h> | ||
8 | #include <linux/highmem.h> | 9 | #include <linux/highmem.h> |
9 | #include <linux/export.h> | 10 | #include <linux/export.h> |
10 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
11 | #include <linux/vmalloc.h> | 12 | #include <linux/vmalloc.h> |
13 | |||
12 | #include "internal.h" | 14 | #include "internal.h" |
13 | #include <asm/dma.h> | 15 | #include <asm/dma.h> |
14 | #include <asm/pgalloc.h> | 16 | #include <asm/pgalloc.h> |
@@ -461,7 +463,7 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | |||
461 | } | 463 | } |
462 | #endif | 464 | #endif |
463 | 465 | ||
464 | void __attribute__((weak)) __meminit vmemmap_populate_print_last(void) | 466 | void __weak __meminit vmemmap_populate_print_last(void) |
465 | { | 467 | { |
466 | } | 468 | } |
467 | 469 | ||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/mm.h> |
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | #include <linux/string.h> | 3 | #include <linux/string.h> |
4 | #include <linux/compiler.h> | ||
4 | #include <linux/export.h> | 5 | #include <linux/export.h> |
5 | #include <linux/err.h> | 6 | #include <linux/err.h> |
6 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
@@ -307,7 +308,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
307 | * If the architecture not support this function, simply return with no | 308 | * If the architecture not support this function, simply return with no |
308 | * page pinned | 309 | * page pinned |
309 | */ | 310 | */ |
310 | int __attribute__((weak)) __get_user_pages_fast(unsigned long start, | 311 | int __weak __get_user_pages_fast(unsigned long start, |
311 | int nr_pages, int write, struct page **pages) | 312 | int nr_pages, int write, struct page **pages) |
312 | { | 313 | { |
313 | return 0; | 314 | return 0; |
@@ -338,7 +339,7 @@ EXPORT_SYMBOL_GPL(__get_user_pages_fast); | |||
338 | * callers need to carefully consider what to use. On many architectures, | 339 | * callers need to carefully consider what to use. On many architectures, |
339 | * get_user_pages_fast simply falls back to get_user_pages. | 340 | * get_user_pages_fast simply falls back to get_user_pages. |
340 | */ | 341 | */ |
341 | int __attribute__((weak)) get_user_pages_fast(unsigned long start, | 342 | int __weak get_user_pages_fast(unsigned long start, |
342 | int nr_pages, int write, struct page **pages) | 343 | int nr_pages, int write, struct page **pages) |
343 | { | 344 | { |
344 | struct mm_struct *mm = current->mm; | 345 | struct mm_struct *mm = current->mm; |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 0fdf96803c5b..a7b522f4851d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -27,7 +27,9 @@ | |||
27 | #include <linux/pfn.h> | 27 | #include <linux/pfn.h> |
28 | #include <linux/kmemleak.h> | 28 | #include <linux/kmemleak.h> |
29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
30 | #include <linux/compiler.h> | ||
30 | #include <linux/llist.h> | 31 | #include <linux/llist.h> |
32 | |||
31 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
32 | #include <asm/tlbflush.h> | 34 | #include <asm/tlbflush.h> |
33 | #include <asm/shmparam.h> | 35 | #include <asm/shmparam.h> |
@@ -2181,7 +2183,7 @@ EXPORT_SYMBOL(remap_vmalloc_range); | |||
2181 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to | 2183 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to |
2182 | * have one. | 2184 | * have one. |
2183 | */ | 2185 | */ |
2184 | void __attribute__((weak)) vmalloc_sync_all(void) | 2186 | void __weak vmalloc_sync_all(void) |
2185 | { | 2187 | { |
2186 | } | 2188 | } |
2187 | 2189 | ||