aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpu.h
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-10-18 06:06:38 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:28 -0400
commit761bb431908e84d1793c5eb6c2ae2cc4926bed3e (patch)
tree6b9afbc8b7156573da0d095390e4dbb3b16fd82c /include/linux/cpu.h
parent4603ac180a824197c2262747948d0179eb076e9c (diff)
Redefine {un}register_hotcpu_notifier() !HOTPLUG_CPU stubs
The return of the present "do {} while" based stub definition of register_hotcpu_notifier() cannot be checked. This makes the stub asymmetric w.r.t. the real HOTPLUG_CPU=y implementation that is int-returning. So let us redefine this to be consistent with the full version. Also do the same for unregister_hotcpu_notifier(). We cannot define these as static inline functions due to an existing GCC bug (#33172). So define as macros that return appropriately instead (int '0' for the register_hotcpu_notifier case and void for unregister_hotcpu_notifier). Signed-off-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r--include/linux/cpu.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0ad72c4cf312..b79c57569367 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -119,8 +119,9 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
119#define lock_cpu_hotplug() do { } while (0) 119#define lock_cpu_hotplug() do { } while (0)
120#define unlock_cpu_hotplug() do { } while (0) 120#define unlock_cpu_hotplug() do { } while (0)
121#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) 121#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
122#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) 122/* These aren't inline functions due to a GCC bug. */
123#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) 123#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
124#define unregister_hotcpu_notifier(nb) ({ (void)(nb); })
124 125
125/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ 126/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
126static inline int cpu_is_offline(int cpu) { return 0; } 127static inline int cpu_is_offline(int cpu) { return 0; }