diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 11:07:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 11:07:54 -0400 |
commit | 991d79b0d1255f89267a350b0048eca59f100cbb (patch) | |
tree | 65ddf4160f959952d9f4955fda8844374768b83e | |
parent | a87e84b5cdfacf11af4e8a85c4bca9793658536f (diff) | |
parent | 181f7c5dd3832763bdf2756b6d2d8a49bdf12791 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck:
kmemcheck: add missing braces to do-while in kmemcheck_annotate_bitfield
kmemcheck: update documentation
kmemcheck: depend on HAVE_ARCH_KMEMCHECK
kmemcheck: remove useless check
kmemcheck: remove duplicated #include
-rw-r--r-- | Documentation/kmemcheck.txt | 21 | ||||
-rw-r--r-- | arch/x86/mm/kmemcheck/kmemcheck.c | 3 | ||||
-rw-r--r-- | include/linux/kmemcheck.h | 5 | ||||
-rw-r--r-- | lib/Kconfig.kmemcheck | 3 |
4 files changed, 8 insertions, 24 deletions
diff --git a/Documentation/kmemcheck.txt b/Documentation/kmemcheck.txt index 363044609dad..c28f82895d6b 100644 --- a/Documentation/kmemcheck.txt +++ b/Documentation/kmemcheck.txt | |||
@@ -43,26 +43,7 @@ feature. | |||
43 | 1. Downloading | 43 | 1. Downloading |
44 | ============== | 44 | ============== |
45 | 45 | ||
46 | kmemcheck can only be downloaded using git. If you want to write patches | 46 | As of version 2.6.31-rc1, kmemcheck is included in the mainline kernel. |
47 | against the current code, you should use the kmemcheck development branch of | ||
48 | the tip tree. It is also possible to use the linux-next tree, which also | ||
49 | includes the latest version of kmemcheck. | ||
50 | |||
51 | Assuming that you've already cloned the linux-2.6.git repository, all you | ||
52 | have to do is add the -tip tree as a remote, like this: | ||
53 | |||
54 | $ git remote add tip git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git | ||
55 | |||
56 | To actually download the tree, fetch the remote: | ||
57 | |||
58 | $ git fetch tip | ||
59 | |||
60 | And to check out a new local branch with the kmemcheck code: | ||
61 | |||
62 | $ git checkout -b kmemcheck tip/kmemcheck | ||
63 | |||
64 | General instructions for the -tip tree can be found here: | ||
65 | http://people.redhat.com/mingo/tip.git/readme.txt | ||
66 | 47 | ||
67 | 48 | ||
68 | 2. Configuring and compiling | 49 | 2. Configuring and compiling |
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c index 528bf954eb74..8cc183344140 100644 --- a/arch/x86/mm/kmemcheck/kmemcheck.c +++ b/arch/x86/mm/kmemcheck/kmemcheck.c | |||
@@ -225,9 +225,6 @@ void kmemcheck_hide(struct pt_regs *regs) | |||
225 | 225 | ||
226 | BUG_ON(!irqs_disabled()); | 226 | BUG_ON(!irqs_disabled()); |
227 | 227 | ||
228 | if (data->balance == 0) | ||
229 | return; | ||
230 | |||
231 | if (unlikely(data->balance != 1)) { | 228 | if (unlikely(data->balance != 1)) { |
232 | kmemcheck_show_all(); | 229 | kmemcheck_show_all(); |
233 | kmemcheck_error_save_bug(regs); | 230 | kmemcheck_error_save_bug(regs); |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index dc2fd545db00..c8006607f947 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -144,7 +144,10 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
144 | int name##_end[0]; | 144 | int name##_end[0]; |
145 | 145 | ||
146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
147 | do if (ptr) { \ | 147 | do { \ |
148 | if (!ptr) \ | ||
149 | break; \ | ||
150 | \ | ||
148 | int _n = (long) &((ptr)->name##_end) \ | 151 | int _n = (long) &((ptr)->name##_end) \ |
149 | - (long) &((ptr)->name##_begin); \ | 152 | - (long) &((ptr)->name##_begin); \ |
150 | BUILD_BUG_ON(_n < 0); \ | 153 | BUILD_BUG_ON(_n < 0); \ |
diff --git a/lib/Kconfig.kmemcheck b/lib/Kconfig.kmemcheck index 603c81b66549..846e039a86b4 100644 --- a/lib/Kconfig.kmemcheck +++ b/lib/Kconfig.kmemcheck | |||
@@ -1,6 +1,8 @@ | |||
1 | config HAVE_ARCH_KMEMCHECK | 1 | config HAVE_ARCH_KMEMCHECK |
2 | bool | 2 | bool |
3 | 3 | ||
4 | if HAVE_ARCH_KMEMCHECK | ||
5 | |||
4 | menuconfig KMEMCHECK | 6 | menuconfig KMEMCHECK |
5 | bool "kmemcheck: trap use of uninitialized memory" | 7 | bool "kmemcheck: trap use of uninitialized memory" |
6 | depends on DEBUG_KERNEL | 8 | depends on DEBUG_KERNEL |
@@ -89,3 +91,4 @@ config KMEMCHECK_BITOPS_OK | |||
89 | accesses where not all the bits are initialized at the same time. | 91 | accesses where not all the bits are initialized at the same time. |
90 | This may also hide some real bugs. | 92 | This may also hide some real bugs. |
91 | 93 | ||
94 | endif | ||