diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-24 13:08:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-24 13:08:39 -0400 |
commit | ed2d265d1266736bd294332d7f649003943ae36e (patch) | |
tree | 860e5b7bb72933e4a9abacdc2f2d75a0e6254e32 /include/net | |
parent | f1d38e423a697b7aa06e12d3ca4753bcc1aa3531 (diff) | |
parent | 6c03438edeb5c359af35f060ea016ca65671c269 (diff) |
Merge tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Pull <linux/bug.h> cleanup from Paul Gortmaker:
"The changes shown here are to unify linux's BUG support under the one
<linux/bug.h> file. Due to historical reasons, we have some BUG code
in bug.h and some in kernel.h -- i.e. the support for BUILD_BUG in
linux/kernel.h predates the addition of linux/bug.h, but old code in
kernel.h wasn't moved to bug.h at that time. As a band-aid, kernel.h
was including <asm/bug.h> to pseudo link them.
This has caused confusion[1] and general yuck/WTF[2] reactions. Here
is an example that violates the principle of least surprise:
CC lib/string.o
lib/string.c: In function 'strlcat':
lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
make[2]: *** [lib/string.o] Error 1
$
$ grep linux/bug.h lib/string.c
#include <linux/bug.h>
$
We've included <linux/bug.h> for the BUG infrastructure and yet we
still get a compile fail! [We've not kernel.h for BUILD_BUG_ON.] Ugh -
very confusing for someone who is new to kernel development.
With the above in mind, the goals of this changeset are:
1) find and fix any include/*.h files that were relying on the
implicit presence of BUG code.
2) find and fix any C files that were consuming kernel.h and hence
relying on implicitly getting some/all BUG code.
3) Move the BUG related code living in kernel.h to <linux/bug.h>
4) remove the asm/bug.h from kernel.h to finally break the chain.
During development, the order was more like 3-4, build-test, 1-2. But
to ensure that git history for bisect doesn't get needless build
failures introduced, the commits have been reorderd to fix the problem
areas in advance.
[1] https://lkml.org/lkml/2012/1/3/90
[2] https://lkml.org/lkml/2012/1/17/414"
Fix up conflicts (new radeon file, reiserfs header cleanups) as per Paul
and linux-next.
* tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
kernel.h: doesn't explicitly use bug.h, so don't include it.
bug: consolidate BUILD_BUG_ON with other bug code
BUG: headers with BUG/BUG_ON etc. need linux/bug.h
bug.h: add include of it to various implicit C users
lib: fix implicit users of kernel.h for TAINT_WARN
spinlock: macroize assert_spin_locked to avoid bug.h dependency
x86: relocate get/set debugreg fcns to include/asm/debugreg.
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 1 | ||||
-rw-r--r-- | include/net/dst.h | 1 | ||||
-rw-r--r-- | include/net/ip_vs.h | 1 | ||||
-rw-r--r-- | include/net/mac80211.h | 1 | ||||
-rw-r--r-- | include/net/netns/generic.h | 1 | ||||
-rw-r--r-- | include/net/red.h | 1 | ||||
-rw-r--r-- | include/net/tcp.h | 1 | ||||
-rw-r--r-- | include/net/timewait_sock.h | 1 | ||||
-rw-r--r-- | include/net/udp.h | 1 | ||||
-rw-r--r-- | include/net/wpan-phy.h | 1 |
10 files changed, 10 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 69b7ad3a9925..248fb05feb63 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
14 | #include <linux/debugfs.h> | 14 | #include <linux/debugfs.h> |
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/bug.h> | ||
16 | #include <linux/netlink.h> | 17 | #include <linux/netlink.h> |
17 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
18 | #include <linux/nl80211.h> | 19 | #include <linux/nl80211.h> |
diff --git a/include/net/dst.h b/include/net/dst.h index 344c8dd02874..59c5d18cc385 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
13 | #include <linux/rtnetlink.h> | 13 | #include <linux/rtnetlink.h> |
14 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
15 | #include <linux/bug.h> | ||
15 | #include <linux/jiffies.h> | 16 | #include <linux/jiffies.h> |
16 | #include <net/neighbour.h> | 17 | #include <net/neighbour.h> |
17 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ebe517f2da9f..2bdee51ba30d 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/atomic.h> /* for struct atomic_t */ | 16 | #include <linux/atomic.h> /* for struct atomic_t */ |
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
19 | #include <linux/bug.h> | ||
19 | 20 | ||
20 | #include <net/checksum.h> | 21 | #include <net/checksum.h> |
21 | #include <linux/netfilter.h> /* for union nf_inet_addr */ | 22 | #include <linux/netfilter.h> /* for union nf_inet_addr */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9a012be615ff..774cd3e0dcb6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef MAC80211_H | 13 | #ifndef MAC80211_H |
14 | #define MAC80211_H | 14 | #define MAC80211_H |
15 | 15 | ||
16 | #include <linux/bug.h> | ||
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
17 | #include <linux/if_ether.h> | 18 | #include <linux/if_ether.h> |
18 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index d55f43443335..0931618c0f7f 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #ifndef __NET_GENERIC_H__ | 5 | #ifndef __NET_GENERIC_H__ |
6 | #define __NET_GENERIC_H__ | 6 | #define __NET_GENERIC_H__ |
7 | 7 | ||
8 | #include <linux/bug.h> | ||
8 | #include <linux/rcupdate.h> | 9 | #include <linux/rcupdate.h> |
9 | 10 | ||
10 | /* | 11 | /* |
diff --git a/include/net/red.h b/include/net/red.h index 28068ec614b2..77d4c3745cb5 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __NET_SCHED_RED_H | 2 | #define __NET_SCHED_RED_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/bug.h> | ||
5 | #include <net/pkt_sched.h> | 6 | #include <net/pkt_sched.h> |
6 | #include <net/inet_ecn.h> | 7 | #include <net/inet_ecn.h> |
7 | #include <net/dsfield.h> | 8 | #include <net/dsfield.h> |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 8607e6aad42b..f75a04d752cb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
24 | #include <linux/tcp.h> | 24 | #include <linux/tcp.h> |
25 | #include <linux/bug.h> | ||
25 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
26 | #include <linux/cache.h> | 27 | #include <linux/cache.h> |
27 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 053b3cf2c66a..8d6689cb2c66 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define _TIMEWAIT_SOCK_H | 12 | #define _TIMEWAIT_SOCK_H |
13 | 13 | ||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/bug.h> | ||
15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
16 | 17 | ||
17 | struct timewait_sock_ops { | 18 | struct timewait_sock_ops { |
diff --git a/include/net/udp.h b/include/net/udp.h index e39592f682c3..5d606d9da9e5 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define _UDP_H | 23 | #define _UDP_H |
24 | 24 | ||
25 | #include <linux/list.h> | 25 | #include <linux/list.h> |
26 | #include <linux/bug.h> | ||
26 | #include <net/inet_sock.h> | 27 | #include <net/inet_sock.h> |
27 | #include <net/sock.h> | 28 | #include <net/sock.h> |
28 | #include <net/snmp.h> | 29 | #include <net/snmp.h> |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index d86fffd3c03c..ff27f1b078d1 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/netdevice.h> | 24 | #include <linux/netdevice.h> |
25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
26 | #include <linux/bug.h> | ||
26 | 27 | ||
27 | struct wpan_phy { | 28 | struct wpan_phy { |
28 | struct mutex pib_lock; | 29 | struct mutex pib_lock; |