diff options
Diffstat (limited to 'include/linux/kmemcheck.h')
-rw-r--r-- | include/linux/kmemcheck.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index 47b39b7c7e84..c8006607f947 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -34,6 +34,8 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | |||
34 | int kmemcheck_show_addr(unsigned long address); | 34 | int kmemcheck_show_addr(unsigned long address); |
35 | int kmemcheck_hide_addr(unsigned long address); | 35 | int kmemcheck_hide_addr(unsigned long address); |
36 | 36 | ||
37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | ||
38 | |||
37 | #else | 39 | #else |
38 | #define kmemcheck_enabled 0 | 40 | #define kmemcheck_enabled 0 |
39 | 41 | ||
@@ -99,6 +101,11 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p, | |||
99 | { | 101 | { |
100 | } | 102 | } |
101 | 103 | ||
104 | static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | ||
105 | { | ||
106 | return true; | ||
107 | } | ||
108 | |||
102 | #endif /* CONFIG_KMEMCHECK */ | 109 | #endif /* CONFIG_KMEMCHECK */ |
103 | 110 | ||
104 | /* | 111 | /* |
@@ -137,7 +144,10 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p, | |||
137 | int name##_end[0]; | 144 | int name##_end[0]; |
138 | 145 | ||
139 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
140 | do if (ptr) { \ | 147 | do { \ |
148 | if (!ptr) \ | ||
149 | break; \ | ||
150 | \ | ||
141 | int _n = (long) &((ptr)->name##_end) \ | 151 | int _n = (long) &((ptr)->name##_end) \ |
142 | - (long) &((ptr)->name##_begin); \ | 152 | - (long) &((ptr)->name##_begin); \ |
143 | BUILD_BUG_ON(_n < 0); \ | 153 | BUILD_BUG_ON(_n < 0); \ |