aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 11:53:03 +0200
committerVegard Nossum <vegard.nossum@gmail.com>2009-09-21 23:34:24 +0200
commit181f7c5dd3832763bdf2756b6d2d8a49bdf12791 (patch)
tree631dc0c343eac8f16e3f12d5b0a4e968858d40ad
parente3c6c4a8af9e3c4588235444774e66b6483b10ad (diff)
kmemcheck: add missing braces to do-while in kmemcheck_annotate_bitfield
Whether or not the sparse warning warning: do-while statement is not a compound statement is justified or not in this case, it is annoying and trivial to fix. [vegard.nossum@gmail.com: title and cleanup] Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
-rw-r--r--include/linux/kmemcheck.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
index 47b39b7c7e8..06c6c5501f1 100644
--- a/include/linux/kmemcheck.h
+++ b/include/linux/kmemcheck.h
@@ -137,7 +137,10 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p,
int name##_end[0];
#define kmemcheck_annotate_bitfield(ptr, name) \
- do if (ptr) { \
+ do { \
+ if (!ptr) \
+ break; \
+ \
int _n = (long) &((ptr)->name##_end) \
- (long) &((ptr)->name##_begin); \
BUILD_BUG_ON(_n < 0); \