aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
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/sched
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/sched')
-rw-r--r--kernel/sched/clock.c3
-rw-r--r--kernel/sched/core.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index b30a2924ef14..3ef6451e972e 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -60,13 +60,14 @@
60#include <linux/sched.h> 60#include <linux/sched.h>
61#include <linux/static_key.h> 61#include <linux/static_key.h>
62#include <linux/workqueue.h> 62#include <linux/workqueue.h>
63#include <linux/compiler.h>
63 64
64/* 65/*
65 * Scheduler clock - returns current time in nanosec units. 66 * Scheduler clock - returns current time in nanosec units.
66 * This is default implementation. 67 * This is default implementation.
67 * Architectures and sub-architectures can override this. 68 * Architectures and sub-architectures can override this.
68 */ 69 */
69unsigned long long __attribute__((weak)) sched_clock(void) 70unsigned long long __weak sched_clock(void)
70{ 71{
71 return (unsigned long long)(jiffies - INITIAL_JIFFIES) 72 return (unsigned long long)(jiffies - INITIAL_JIFFIES)
72 * (NSEC_PER_SEC / HZ); 73 * (NSEC_PER_SEC / HZ);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1d1b87b36778..80bd491b718c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -73,6 +73,7 @@
73#include <linux/init_task.h> 73#include <linux/init_task.h>
74#include <linux/binfmts.h> 74#include <linux/binfmts.h>
75#include <linux/context_tracking.h> 75#include <linux/context_tracking.h>
76#include <linux/compiler.h>
76 77
77#include <asm/switch_to.h> 78#include <asm/switch_to.h>
78#include <asm/tlb.h> 79#include <asm/tlb.h>
@@ -6498,7 +6499,7 @@ static cpumask_var_t fallback_doms;
6498 * cpu core maps. It is supposed to return 1 if the topology changed 6499 * cpu core maps. It is supposed to return 1 if the topology changed
6499 * or 0 if it stayed the same. 6500 * or 0 if it stayed the same.
6500 */ 6501 */
6501int __attribute__((weak)) arch_update_cpu_topology(void) 6502int __weak arch_update_cpu_topology(void)
6502{ 6503{
6503 return 0; 6504 return 0;
6504} 6505}