diff options
author | Joe Perches <joe@perches.com> | 2013-12-05 19:19:15 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-17 18:01:52 -0500 |
commit | 0adab9b9aa18d7e90337d43567f1eec3d5401b81 (patch) | |
tree | 4b398dce5633252a65ed8848cded768c71577c4f | |
parent | 41f4abd92a34f9c5110bbb870c04f8854604e28d (diff) |
rcu: Indentation and spacing fixes.
This commit outdents expression-statement macros, thus repairing a few
line-length complaints. Also fix some spacing errors called out by
checkpatch.pl.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r-- | include/linux/rculist.h | 17 | ||||
-rw-r--r-- | include/linux/rcupdate.h | 58 |
2 files changed, 38 insertions, 37 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index dbaf99084112..8183b46fbaa2 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -247,9 +247,10 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
247 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 247 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
248 | */ | 248 | */ |
249 | #define list_entry_rcu(ptr, type, member) \ | 249 | #define list_entry_rcu(ptr, type, member) \ |
250 | ({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \ | 250 | ({ \ |
251 | container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ | 251 | typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \ |
252 | }) | 252 | container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ |
253 | }) | ||
253 | 254 | ||
254 | /** | 255 | /** |
255 | * Where are list_empty_rcu() and list_first_entry_rcu()? | 256 | * Where are list_empty_rcu() and list_first_entry_rcu()? |
@@ -285,11 +286,11 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
285 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 286 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
286 | */ | 287 | */ |
287 | #define list_first_or_null_rcu(ptr, type, member) \ | 288 | #define list_first_or_null_rcu(ptr, type, member) \ |
288 | ({struct list_head *__ptr = (ptr); \ | 289 | ({ \ |
289 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ | 290 | struct list_head *__ptr = (ptr); \ |
290 | likely(__ptr != __next) ? \ | 291 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ |
291 | list_entry_rcu(__next, type, member) : NULL; \ | 292 | likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \ |
292 | }) | 293 | }) |
293 | 294 | ||
294 | /** | 295 | /** |
295 | * list_for_each_entry_rcu - iterate over rcu list of given type | 296 | * list_for_each_entry_rcu - iterate over rcu list of given type |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index d946d3660633..278a9da69ec4 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -508,40 +508,40 @@ static inline void rcu_preempt_sleep_check(void) | |||
508 | #endif /* #else #ifdef __CHECKER__ */ | 508 | #endif /* #else #ifdef __CHECKER__ */ |
509 | 509 | ||
510 | #define __rcu_access_pointer(p, space) \ | 510 | #define __rcu_access_pointer(p, space) \ |
511 | ({ \ | 511 | ({ \ |
512 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 512 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ |
513 | rcu_dereference_sparse(p, space); \ | 513 | rcu_dereference_sparse(p, space); \ |
514 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 514 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
515 | }) | 515 | }) |
516 | #define __rcu_dereference_check(p, c, space) \ | 516 | #define __rcu_dereference_check(p, c, space) \ |
517 | ({ \ | 517 | ({ \ |
518 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 518 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ |
519 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ | 519 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ |
520 | rcu_dereference_sparse(p, space); \ | 520 | rcu_dereference_sparse(p, space); \ |
521 | smp_read_barrier_depends(); \ | 521 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ |
522 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 522 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
523 | }) | 523 | }) |
524 | #define __rcu_dereference_protected(p, c, space) \ | 524 | #define __rcu_dereference_protected(p, c, space) \ |
525 | ({ \ | 525 | ({ \ |
526 | rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ | 526 | rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ |
527 | rcu_dereference_sparse(p, space); \ | 527 | rcu_dereference_sparse(p, space); \ |
528 | ((typeof(*p) __force __kernel *)(p)); \ | 528 | ((typeof(*p) __force __kernel *)(p)); \ |
529 | }) | 529 | }) |
530 | 530 | ||
531 | #define __rcu_access_index(p, space) \ | 531 | #define __rcu_access_index(p, space) \ |
532 | ({ \ | 532 | ({ \ |
533 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 533 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
534 | rcu_dereference_sparse(p, space); \ | 534 | rcu_dereference_sparse(p, space); \ |
535 | (_________p1); \ | 535 | (_________p1); \ |
536 | }) | 536 | }) |
537 | #define __rcu_dereference_index_check(p, c) \ | 537 | #define __rcu_dereference_index_check(p, c) \ |
538 | ({ \ | 538 | ({ \ |
539 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 539 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
540 | rcu_lockdep_assert(c, \ | 540 | rcu_lockdep_assert(c, \ |
541 | "suspicious rcu_dereference_index_check() usage"); \ | 541 | "suspicious rcu_dereference_index_check() usage"); \ |
542 | smp_read_barrier_depends(); \ | 542 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ |
543 | (_________p1); \ | 543 | (_________p1); \ |
544 | }) | 544 | }) |
545 | 545 | ||
546 | /** | 546 | /** |
547 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable | 547 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable |