aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kmemcheck.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kmemcheck.h')
-rw-r--r--include/linux/kmemcheck.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
index dc2fd545db0..e880d4cf9e2 100644
--- a/include/linux/kmemcheck.h
+++ b/include/linux/kmemcheck.h
@@ -144,10 +144,15 @@ 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 int _n = (long) &((ptr)->name##_end) \ 148 int _n; \
149 \
150 if (!ptr) \
151 break; \
152 \
153 _n = (long) &((ptr)->name##_end) \
149 - (long) &((ptr)->name##_begin); \ 154 - (long) &((ptr)->name##_begin); \
150 BUILD_BUG_ON(_n < 0); \ 155 MAYBE_BUILD_BUG_ON(_n < 0); \
151 \ 156 \
152 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ 157 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
153 } while (0) 158 } while (0)