aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorGideon Israel Dsouza <gidisrael@gmail.com>2014-04-07 18:39:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:11 -0400
commit52f5684c8e1ec7463192aba8e2916df49807511a (patch)
treef8e6061de05014e89e58638f626831f2c38af971 /kernel/power
parentce816fa88cca083c47ab9000b2138a83043a78be (diff)
kernel: 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 kernel subsystem. Signed-off-by: Gideon Israel Dsouza <gidisrael@gmail.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/power.h3
-rw-r--r--kernel/power/snapshot.c3
-rw-r--r--kernel/power/suspend.c5
-rw-r--r--kernel/power/swap.c2
4 files changed, 8 insertions, 5 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 1ca753106557..15f37ea08719 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -2,6 +2,7 @@
2#include <linux/suspend_ioctls.h> 2#include <linux/suspend_ioctls.h>
3#include <linux/utsname.h> 3#include <linux/utsname.h>
4#include <linux/freezer.h> 4#include <linux/freezer.h>
5#include <linux/compiler.h>
5 6
6struct swsusp_info { 7struct swsusp_info {
7 struct new_utsname uts; 8 struct new_utsname uts;
@@ -11,7 +12,7 @@ struct swsusp_info {
11 unsigned long image_pages; 12 unsigned long image_pages;
12 unsigned long pages; 13 unsigned long pages;
13 unsigned long size; 14 unsigned long size;
14} __attribute__((aligned(PAGE_SIZE))); 15} __aligned(PAGE_SIZE);
15 16
16#ifdef CONFIG_HIBERNATION 17#ifdef CONFIG_HIBERNATION
17/* kernel/power/snapshot.c */ 18/* kernel/power/snapshot.c */
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 149e745eaa52..18fb7a2fb14b 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -27,6 +27,7 @@
27#include <linux/highmem.h> 27#include <linux/highmem.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/compiler.h>
30 31
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
@@ -155,7 +156,7 @@ static inline void free_image_page(void *addr, int clear_nosave_free)
155struct linked_page { 156struct linked_page {
156 struct linked_page *next; 157 struct linked_page *next;
157 char data[LINKED_PAGE_DATA_SIZE]; 158 char data[LINKED_PAGE_DATA_SIZE];
158} __attribute__((packed)); 159} __packed;
159 160
160static inline void 161static inline void
161free_list_of_pages(struct linked_page *list, int clear_page_nosave) 162free_list_of_pages(struct linked_page *list, int clear_page_nosave)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 90b3d9366d1a..c3ad9cafe930 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -26,6 +26,7 @@
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27#include <linux/ftrace.h> 27#include <linux/ftrace.h>
28#include <trace/events/power.h> 28#include <trace/events/power.h>
29#include <linux/compiler.h>
29 30
30#include "power.h" 31#include "power.h"
31 32
@@ -156,13 +157,13 @@ static int suspend_prepare(suspend_state_t state)
156} 157}
157 158
158/* default implementation */ 159/* default implementation */
159void __attribute__ ((weak)) arch_suspend_disable_irqs(void) 160void __weak arch_suspend_disable_irqs(void)
160{ 161{
161 local_irq_disable(); 162 local_irq_disable();
162} 163}
163 164
164/* default implementation */ 165/* default implementation */
165void __attribute__ ((weak)) arch_suspend_enable_irqs(void) 166void __weak arch_suspend_enable_irqs(void)
166{ 167{
167 local_irq_enable(); 168 local_irq_enable();
168} 169}
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 7c33ed200410..8c9a4819f798 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -101,7 +101,7 @@ struct swsusp_header {
101 unsigned int flags; /* Flags to pass to the "boot" kernel */ 101 unsigned int flags; /* Flags to pass to the "boot" kernel */
102 char orig_sig[10]; 102 char orig_sig[10];
103 char sig[10]; 103 char sig[10];
104} __attribute__((packed)); 104} __packed;
105 105
106static struct swsusp_header *swsusp_header; 106static struct swsusp_header *swsusp_header;
107 107