Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] add bottom_half.h

With CONFIG_SMP=n:

drivers/input/ff-memless.c:384: warning: implicit declaration of function 'local_bh_disable'
drivers/input/ff-memless.c:393: warning: implicit declaration of function 'local_bh_enable'

Really linux/spinlock.h should include linux/interrupt.h. But interrupt.h
includes sched.h which will need spinlock.h.

So the patch breaks the _bh declarations out into a separate header and
includes it in both interrupt.h and spinlock.h.

Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: Andi Kleen <ak@suse.de>
Cc: <stable@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andrew Morton and committed by
Linus Torvalds
676dcb8b 620034c8

+12 -6
+10
include/linux/bottom_half.h
··· 1 + #ifndef _LINUX_BH_H 2 + #define _LINUX_BH_H 3 + 4 + extern void local_bh_disable(void); 5 + extern void __local_bh_enable(void); 6 + extern void _local_bh_enable(void); 7 + extern void local_bh_enable(void); 8 + extern void local_bh_enable_ip(unsigned long ip); 9 + 10 + #endif /* _LINUX_BH_H */
+1 -6
include/linux/interrupt.h
··· 11 11 #include <linux/hardirq.h> 12 12 #include <linux/sched.h> 13 13 #include <linux/irqflags.h> 14 + #include <linux/bottom_half.h> 14 15 #include <asm/atomic.h> 15 16 #include <asm/ptrace.h> 16 17 #include <asm/system.h> ··· 217 216 } 218 217 #define save_and_cli(x) save_and_cli(&x) 219 218 #endif /* CONFIG_SMP */ 220 - 221 - extern void local_bh_disable(void); 222 - extern void __local_bh_enable(void); 223 - extern void _local_bh_enable(void); 224 - extern void local_bh_enable(void); 225 - extern void local_bh_enable_ip(unsigned long ip); 226 219 227 220 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high 228 221 frequency threaded job scheduling. For almost all the purposes
+1
include/linux/spinlock.h
··· 52 52 #include <linux/thread_info.h> 53 53 #include <linux/kernel.h> 54 54 #include <linux/stringify.h> 55 + #include <linux/bottom_half.h> 55 56 56 57 #include <asm/system.h> 57 58