Skip to contentSkip to conversation

Linux v2.5.29

DISCUSSION Rusty Russell 1 participant 1 message Jul 27, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

In message <[email protected]> you write:

Quoted 5 lines

While you're there, this register_cpu_notifier() call generates a compile warning on UP:

softirq.c: In function `spawn_ksoftirqd':
softirq.c:416: warning: statement with no effect

Thanks Andrew...

Name: Hot-plug CPU notifier warning fix
Author: Rusty Russell
Status: Trivial

D: As pointed out by Andrew Morton, this fixes:
D: softirq.c: In function `spawn_ksoftirqd':
D: softirq.c:416: warning: statement with no effect

This patch alters the boot sequence to "plug in" each CPU, one at a

include/linux/smp.h +7 -3
diff -urpN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.29/include/linux/smp.h working-2.5.29-register-cpu-fix/include/linux/smp.h
@@ -101,9 +101,13 @@ static inline void smp_send_reschedule_a
 #define this_cpu(var)				var
 
 /* Need to know about CPUs going up/down? */
-#define register_cpu_notifier(nb) 0
-#define unregister_cpu_notifier(nb) do { } while(0)
-
+static inline int register_cpu_notifier(struct notifier_block *nb)
+{
+	return 0;
+}
+static inline void unregister_cpu_notifier(struct notifier_block *nb)
+{
+}
 #endif /* !SMP */
 
 #define get_cpu()		({ preempt_disable(); smp_processor_id(); })

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.