diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rcupdate.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 89414d67d961..03cda7bed985 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -310,24 +310,32 @@ extern int rcu_my_thread_group_empty(void); | |||
310 | * (e.g., __rcu_bh, * __rcu_sched, and __srcu), should this make sense in | 310 | * (e.g., __rcu_bh, * __rcu_sched, and __srcu), should this make sense in |
311 | * the future. | 311 | * the future. |
312 | */ | 312 | */ |
313 | |||
314 | #ifdef __CHECKER__ | ||
315 | #define rcu_dereference_sparse(p, space) \ | ||
316 | ((void)(((typeof(*p) space *)p) == p)) | ||
317 | #else /* #ifdef __CHECKER__ */ | ||
318 | #define rcu_dereference_sparse(p, space) | ||
319 | #endif /* #else #ifdef __CHECKER__ */ | ||
320 | |||
313 | #define __rcu_access_pointer(p, space) \ | 321 | #define __rcu_access_pointer(p, space) \ |
314 | ({ \ | 322 | ({ \ |
315 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 323 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ |
316 | (void) (((typeof (*p) space *)p) == p); \ | 324 | rcu_dereference_sparse(p, space); \ |
317 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 325 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
318 | }) | 326 | }) |
319 | #define __rcu_dereference_check(p, c, space) \ | 327 | #define __rcu_dereference_check(p, c, space) \ |
320 | ({ \ | 328 | ({ \ |
321 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 329 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ |
322 | rcu_lockdep_assert(c); \ | 330 | rcu_lockdep_assert(c); \ |
323 | (void) (((typeof (*p) space *)p) == p); \ | 331 | rcu_dereference_sparse(p, space); \ |
324 | smp_read_barrier_depends(); \ | 332 | smp_read_barrier_depends(); \ |
325 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 333 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
326 | }) | 334 | }) |
327 | #define __rcu_dereference_protected(p, c, space) \ | 335 | #define __rcu_dereference_protected(p, c, space) \ |
328 | ({ \ | 336 | ({ \ |
329 | rcu_lockdep_assert(c); \ | 337 | rcu_lockdep_assert(c); \ |
330 | (void) (((typeof (*p) space *)p) == p); \ | 338 | rcu_dereference_sparse(p, space); \ |
331 | ((typeof(*p) __force __kernel *)(p)); \ | 339 | ((typeof(*p) __force __kernel *)(p)); \ |
332 | }) | 340 | }) |
333 | 341 | ||