aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 13:08:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 13:08:39 -0400
commited2d265d1266736bd294332d7f649003943ae36e (patch)
tree860e5b7bb72933e4a9abacdc2f2d75a0e6254e32 /lib
parentf1d38e423a697b7aa06e12d3ca4753bcc1aa3531 (diff)
parent6c03438edeb5c359af35f060ea016ca65671c269 (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 'lib')
-rw-r--r--lib/atomic64_test.c1
-rw-r--r--lib/average.c1
-rw-r--r--lib/bitmap.c1
-rw-r--r--lib/iommu-helper.c1
-rw-r--r--lib/list_debug.c2
-rw-r--r--lib/plist.c1
-rw-r--r--lib/string.c1
-rw-r--r--lib/timerqueue.c1
8 files changed, 9 insertions, 0 deletions
diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c
index 0c33cde2a1e6..cb99b91c3a1d 100644
--- a/lib/atomic64_test.c
+++ b/lib/atomic64_test.c
@@ -9,6 +9,7 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/bug.h>
12#include <linux/kernel.h> 13#include <linux/kernel.h>
13#include <linux/atomic.h> 14#include <linux/atomic.h>
14 15
diff --git a/lib/average.c b/lib/average.c
index 5576c2841496..57c38c6e39cd 100644
--- a/lib/average.c
+++ b/lib/average.c
@@ -7,6 +7,7 @@
7 7
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/average.h> 9#include <linux/average.h>
10#include <linux/kernel.h>
10#include <linux/bug.h> 11#include <linux/bug.h>
11#include <linux/log2.h> 12#include <linux/log2.h>
12 13
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 0d4a127dd9b3..90a683b34075 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -10,6 +10,7 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/bitmap.h> 11#include <linux/bitmap.h>
12#include <linux/bitops.h> 12#include <linux/bitops.h>
13#include <linux/bug.h>
13#include <asm/uaccess.h> 14#include <asm/uaccess.h>
14 15
15/* 16/*
diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
index da053313ee5c..8b1ab6222562 100644
--- a/lib/iommu-helper.c
+++ b/lib/iommu-helper.c
@@ -4,6 +4,7 @@
4 4
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/bitmap.h> 6#include <linux/bitmap.h>
7#include <linux/bug.h>
7 8
8int iommu_is_span_boundary(unsigned int index, unsigned int nr, 9int iommu_is_span_boundary(unsigned int index, unsigned int nr,
9 unsigned long shift, 10 unsigned long shift,
diff --git a/lib/list_debug.c b/lib/list_debug.c
index b8029a5583ff..1bf2fe36f813 100644
--- a/lib/list_debug.c
+++ b/lib/list_debug.c
@@ -8,6 +8,8 @@
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/list.h> 10#include <linux/list.h>
11#include <linux/bug.h>
12#include <linux/kernel.h>
11 13
12/* 14/*
13 * Insert a new entry between two known consecutive entries. 15 * Insert a new entry between two known consecutive entries.
diff --git a/lib/plist.c b/lib/plist.c
index a0a4da489c22..6ab0e521c48b 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -23,6 +23,7 @@
23 * information. 23 * information.
24 */ 24 */
25 25
26#include <linux/bug.h>
26#include <linux/plist.h> 27#include <linux/plist.h>
27#include <linux/spinlock.h> 28#include <linux/spinlock.h>
28 29
diff --git a/lib/string.c b/lib/string.c
index 3a03782720c8..3a15eb16f48a 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -22,6 +22,7 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/ctype.h> 24#include <linux/ctype.h>
25#include <linux/bug.h>
25#include <linux/module.h> 26#include <linux/module.h>
26 27
27#ifndef __HAVE_ARCH_STRNICMP 28#ifndef __HAVE_ARCH_STRNICMP
diff --git a/lib/timerqueue.c b/lib/timerqueue.c
index 191176a43e9a..14c640355eb1 100644
--- a/lib/timerqueue.c
+++ b/lib/timerqueue.c
@@ -22,6 +22,7 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 24
25#include <linux/bug.h>
25#include <linux/timerqueue.h> 26#include <linux/timerqueue.h>
26#include <linux/rbtree.h> 27#include <linux/rbtree.h>
27#include <linux/module.h> 28#include <linux/module.h>