Skip to content

Commit

Permalink
[PATCH] hotcpu_notifier-fixes
Browse files Browse the repository at this point in the history
Always use do {} while (0).  Failing to do so can cause subtle compile
failures or bugs.

Cc: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jul 1, 2006
1 parent 1add678 commit e2c2770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ int cpu_down(unsigned int cpu);
#define lock_cpu_hotplug() do { } while (0)
#define unlock_cpu_hotplug() do { } while (0)
#define lock_cpu_hotplug_interruptible() 0
#define hotcpu_notifier(fn, pri)
#define register_hotcpu_notifier(nb)
#define unregister_hotcpu_notifier(nb)
#define hotcpu_notifier(fn, pri) do { } while (0)
#define register_hotcpu_notifier(nb) do { } while (0)
#define unregister_hotcpu_notifier(nb) do { } while (0)

/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
static inline int cpu_is_offline(int cpu) { return 0; }
Expand Down

0 comments on commit e2c2770

Please sign in to comment.