diff options
author | Boqun Feng <boqun.feng@gmail.com> | 2015-07-29 01:29:38 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-10-06 14:08:05 -0400 |
commit | b6a4ae766e3133a4db73fabc81e522d1601cb623 (patch) | |
tree | 24f5e9c33b0f89e7e2addd66e32d0e1ca3d16efa | |
parent | 84778472e1b6a27a8931712c40e8cf31143c8f6c (diff) |
rcu: Use rcu_callback_t in call_rcu*() and friends
As we now have rcu_callback_t typedefs as the type of rcu callbacks, we
should use it in call_rcu*() and friends as the type of parameters. This
could save us a few lines of code and make it clear which function
requires an rcu callbacks rather than other callbacks as its argument.
Besides, this can also help cscope to generate a better database for
code reading.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r-- | include/linux/rcupdate.h | 10 | ||||
-rw-r--r-- | include/linux/rcutiny.h | 2 | ||||
-rw-r--r-- | include/linux/rcutree.h | 2 | ||||
-rw-r--r-- | kernel/rcu/rcutorture.c | 4 | ||||
-rw-r--r-- | kernel/rcu/srcu.c | 2 | ||||
-rw-r--r-- | kernel/rcu/tiny.c | 8 | ||||
-rw-r--r-- | kernel/rcu/tree.c | 8 | ||||
-rw-r--r-- | kernel/rcu/tree.h | 2 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 2 | ||||
-rw-r--r-- | kernel/rcu/update.c | 2 |
10 files changed, 21 insertions, 21 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 581abf848566..d63bb77dab35 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -160,7 +160,7 @@ void do_trace_rcu_torture_read(const char *rcutorturename, | |||
160 | * more than one CPU). | 160 | * more than one CPU). |
161 | */ | 161 | */ |
162 | void call_rcu(struct rcu_head *head, | 162 | void call_rcu(struct rcu_head *head, |
163 | void (*func)(struct rcu_head *head)); | 163 | rcu_callback_t func); |
164 | 164 | ||
165 | #else /* #ifdef CONFIG_PREEMPT_RCU */ | 165 | #else /* #ifdef CONFIG_PREEMPT_RCU */ |
166 | 166 | ||
@@ -191,7 +191,7 @@ void call_rcu(struct rcu_head *head, | |||
191 | * memory ordering guarantees. | 191 | * memory ordering guarantees. |
192 | */ | 192 | */ |
193 | void call_rcu_bh(struct rcu_head *head, | 193 | void call_rcu_bh(struct rcu_head *head, |
194 | void (*func)(struct rcu_head *head)); | 194 | rcu_callback_t func); |
195 | 195 | ||
196 | /** | 196 | /** |
197 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. | 197 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. |
@@ -213,7 +213,7 @@ void call_rcu_bh(struct rcu_head *head, | |||
213 | * memory ordering guarantees. | 213 | * memory ordering guarantees. |
214 | */ | 214 | */ |
215 | void call_rcu_sched(struct rcu_head *head, | 215 | void call_rcu_sched(struct rcu_head *head, |
216 | void (*func)(struct rcu_head *rcu)); | 216 | rcu_callback_t func); |
217 | 217 | ||
218 | void synchronize_sched(void); | 218 | void synchronize_sched(void); |
219 | 219 | ||
@@ -274,7 +274,7 @@ do { \ | |||
274 | * See the description of call_rcu() for more detailed information on | 274 | * See the description of call_rcu() for more detailed information on |
275 | * memory ordering guarantees. | 275 | * memory ordering guarantees. |
276 | */ | 276 | */ |
277 | void call_rcu_tasks(struct rcu_head *head, void (*func)(struct rcu_head *head)); | 277 | void call_rcu_tasks(struct rcu_head *head, rcu_callback_t func); |
278 | void synchronize_rcu_tasks(void); | 278 | void synchronize_rcu_tasks(void); |
279 | void rcu_barrier_tasks(void); | 279 | void rcu_barrier_tasks(void); |
280 | 280 | ||
@@ -1065,7 +1065,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
1065 | #define __kfree_rcu(head, offset) \ | 1065 | #define __kfree_rcu(head, offset) \ |
1066 | do { \ | 1066 | do { \ |
1067 | BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \ | 1067 | BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \ |
1068 | kfree_call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \ | 1068 | kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \ |
1069 | } while (0) | 1069 | } while (0) |
1070 | 1070 | ||
1071 | /** | 1071 | /** |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index ff968b7af3a4..c8a0722f77ea 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -83,7 +83,7 @@ static inline void synchronize_sched_expedited(void) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | static inline void kfree_call_rcu(struct rcu_head *head, | 85 | static inline void kfree_call_rcu(struct rcu_head *head, |
86 | void (*func)(struct rcu_head *rcu)) | 86 | rcu_callback_t func) |
87 | { | 87 | { |
88 | call_rcu(head, func); | 88 | call_rcu(head, func); |
89 | } | 89 | } |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 5abec82f325e..60d15a080d7c 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -48,7 +48,7 @@ void synchronize_rcu_bh(void); | |||
48 | void synchronize_sched_expedited(void); | 48 | void synchronize_sched_expedited(void); |
49 | void synchronize_rcu_expedited(void); | 49 | void synchronize_rcu_expedited(void); |
50 | 50 | ||
51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | 51 | void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func); |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * synchronize_rcu_bh_expedited - Brute-force RCU-bh grace period | 54 | * synchronize_rcu_bh_expedited - Brute-force RCU-bh grace period |
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 77192953dee5..51c8e7f02f48 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c | |||
@@ -448,7 +448,7 @@ static void synchronize_rcu_busted(void) | |||
448 | } | 448 | } |
449 | 449 | ||
450 | static void | 450 | static void |
451 | call_rcu_busted(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 451 | call_rcu_busted(struct rcu_head *head, rcu_callback_t func) |
452 | { | 452 | { |
453 | /* This is a deliberate bug for testing purposes only! */ | 453 | /* This is a deliberate bug for testing purposes only! */ |
454 | func(head); | 454 | func(head); |
@@ -523,7 +523,7 @@ static void srcu_torture_synchronize(void) | |||
523 | } | 523 | } |
524 | 524 | ||
525 | static void srcu_torture_call(struct rcu_head *head, | 525 | static void srcu_torture_call(struct rcu_head *head, |
526 | void (*func)(struct rcu_head *head)) | 526 | rcu_callback_t func) |
527 | { | 527 | { |
528 | call_srcu(srcu_ctlp, head, func); | 528 | call_srcu(srcu_ctlp, head, func); |
529 | } | 529 | } |
diff --git a/kernel/rcu/srcu.c b/kernel/rcu/srcu.c index d3fcb2ec8536..9e6122540d28 100644 --- a/kernel/rcu/srcu.c +++ b/kernel/rcu/srcu.c | |||
@@ -387,7 +387,7 @@ static void srcu_flip(struct srcu_struct *sp) | |||
387 | * srcu_struct structure. | 387 | * srcu_struct structure. |
388 | */ | 388 | */ |
389 | void call_srcu(struct srcu_struct *sp, struct rcu_head *head, | 389 | void call_srcu(struct srcu_struct *sp, struct rcu_head *head, |
390 | void (*func)(struct rcu_head *head)) | 390 | rcu_callback_t func) |
391 | { | 391 | { |
392 | unsigned long flags; | 392 | unsigned long flags; |
393 | 393 | ||
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index d0471056d0af..944b1b491ed8 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c | |||
@@ -44,7 +44,7 @@ struct rcu_ctrlblk; | |||
44 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); | 44 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); |
45 | static void rcu_process_callbacks(struct softirq_action *unused); | 45 | static void rcu_process_callbacks(struct softirq_action *unused); |
46 | static void __call_rcu(struct rcu_head *head, | 46 | static void __call_rcu(struct rcu_head *head, |
47 | void (*func)(struct rcu_head *rcu), | 47 | rcu_callback_t func, |
48 | struct rcu_ctrlblk *rcp); | 48 | struct rcu_ctrlblk *rcp); |
49 | 49 | ||
50 | #include "tiny_plugin.h" | 50 | #include "tiny_plugin.h" |
@@ -203,7 +203,7 @@ EXPORT_SYMBOL_GPL(synchronize_sched); | |||
203 | * Helper function for call_rcu() and call_rcu_bh(). | 203 | * Helper function for call_rcu() and call_rcu_bh(). |
204 | */ | 204 | */ |
205 | static void __call_rcu(struct rcu_head *head, | 205 | static void __call_rcu(struct rcu_head *head, |
206 | void (*func)(struct rcu_head *rcu), | 206 | rcu_callback_t func, |
207 | struct rcu_ctrlblk *rcp) | 207 | struct rcu_ctrlblk *rcp) |
208 | { | 208 | { |
209 | unsigned long flags; | 209 | unsigned long flags; |
@@ -229,7 +229,7 @@ static void __call_rcu(struct rcu_head *head, | |||
229 | * period. But since we have but one CPU, that would be after any | 229 | * period. But since we have but one CPU, that would be after any |
230 | * quiescent state. | 230 | * quiescent state. |
231 | */ | 231 | */ |
232 | void call_rcu_sched(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 232 | void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) |
233 | { | 233 | { |
234 | __call_rcu(head, func, &rcu_sched_ctrlblk); | 234 | __call_rcu(head, func, &rcu_sched_ctrlblk); |
235 | } | 235 | } |
@@ -239,7 +239,7 @@ EXPORT_SYMBOL_GPL(call_rcu_sched); | |||
239 | * Post an RCU bottom-half callback to be invoked after any subsequent | 239 | * Post an RCU bottom-half callback to be invoked after any subsequent |
240 | * quiescent state. | 240 | * quiescent state. |
241 | */ | 241 | */ |
242 | void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 242 | void call_rcu_bh(struct rcu_head *head, rcu_callback_t func) |
243 | { | 243 | { |
244 | __call_rcu(head, func, &rcu_bh_ctrlblk); | 244 | __call_rcu(head, func, &rcu_bh_ctrlblk); |
245 | } | 245 | } |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 775d36cc0050..b9d9e0249e2f 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -3017,7 +3017,7 @@ static void rcu_leak_callback(struct rcu_head *rhp) | |||
3017 | * is expected to specify a CPU. | 3017 | * is expected to specify a CPU. |
3018 | */ | 3018 | */ |
3019 | static void | 3019 | static void |
3020 | __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), | 3020 | __call_rcu(struct rcu_head *head, rcu_callback_t func, |
3021 | struct rcu_state *rsp, int cpu, bool lazy) | 3021 | struct rcu_state *rsp, int cpu, bool lazy) |
3022 | { | 3022 | { |
3023 | unsigned long flags; | 3023 | unsigned long flags; |
@@ -3088,7 +3088,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), | |||
3088 | /* | 3088 | /* |
3089 | * Queue an RCU-sched callback for invocation after a grace period. | 3089 | * Queue an RCU-sched callback for invocation after a grace period. |
3090 | */ | 3090 | */ |
3091 | void call_rcu_sched(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 3091 | void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) |
3092 | { | 3092 | { |
3093 | __call_rcu(head, func, &rcu_sched_state, -1, 0); | 3093 | __call_rcu(head, func, &rcu_sched_state, -1, 0); |
3094 | } | 3094 | } |
@@ -3097,7 +3097,7 @@ EXPORT_SYMBOL_GPL(call_rcu_sched); | |||
3097 | /* | 3097 | /* |
3098 | * Queue an RCU callback for invocation after a quicker grace period. | 3098 | * Queue an RCU callback for invocation after a quicker grace period. |
3099 | */ | 3099 | */ |
3100 | void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 3100 | void call_rcu_bh(struct rcu_head *head, rcu_callback_t func) |
3101 | { | 3101 | { |
3102 | __call_rcu(head, func, &rcu_bh_state, -1, 0); | 3102 | __call_rcu(head, func, &rcu_bh_state, -1, 0); |
3103 | } | 3103 | } |
@@ -3111,7 +3111,7 @@ EXPORT_SYMBOL_GPL(call_rcu_bh); | |||
3111 | * function may only be called from __kfree_rcu(). | 3111 | * function may only be called from __kfree_rcu(). |
3112 | */ | 3112 | */ |
3113 | void kfree_call_rcu(struct rcu_head *head, | 3113 | void kfree_call_rcu(struct rcu_head *head, |
3114 | void (*func)(struct rcu_head *rcu)) | 3114 | rcu_callback_t func) |
3115 | { | 3115 | { |
3116 | __call_rcu(head, func, rcu_state_p, -1, 1); | 3116 | __call_rcu(head, func, rcu_state_p, -1, 1); |
3117 | } | 3117 | } |
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 2e991f8361e4..ad11529375cc 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h | |||
@@ -584,7 +584,7 @@ static void rcu_print_detail_task_stall(struct rcu_state *rsp); | |||
584 | static int rcu_print_task_stall(struct rcu_node *rnp); | 584 | static int rcu_print_task_stall(struct rcu_node *rnp); |
585 | static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); | 585 | static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); |
586 | static void rcu_preempt_check_callbacks(void); | 586 | static void rcu_preempt_check_callbacks(void); |
587 | void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | 587 | void call_rcu(struct rcu_head *head, rcu_callback_t func); |
588 | static void __init __rcu_init_preempt(void); | 588 | static void __init __rcu_init_preempt(void); |
589 | static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); | 589 | static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); |
590 | static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); | 590 | static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index b2bf3963a0ae..06116ae6dfd7 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -500,7 +500,7 @@ static void rcu_preempt_do_callbacks(void) | |||
500 | /* | 500 | /* |
501 | * Queue a preemptible-RCU callback for invocation after a grace period. | 501 | * Queue a preemptible-RCU callback for invocation after a grace period. |
502 | */ | 502 | */ |
503 | void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | 503 | void call_rcu(struct rcu_head *head, rcu_callback_t func) |
504 | { | 504 | { |
505 | __call_rcu(head, func, rcu_state_p, -1, 0); | 505 | __call_rcu(head, func, rcu_state_p, -1, 0); |
506 | } | 506 | } |
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 7a0b3bc7c5ed..5f748c5a40f0 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c | |||
@@ -534,7 +534,7 @@ static void rcu_spawn_tasks_kthread(void); | |||
534 | * Post an RCU-tasks callback. First call must be from process context | 534 | * Post an RCU-tasks callback. First call must be from process context |
535 | * after the scheduler if fully operational. | 535 | * after the scheduler if fully operational. |
536 | */ | 536 | */ |
537 | void call_rcu_tasks(struct rcu_head *rhp, void (*func)(struct rcu_head *rhp)) | 537 | void call_rcu_tasks(struct rcu_head *rhp, rcu_callback_t func) |
538 | { | 538 | { |
539 | unsigned long flags; | 539 | unsigned long flags; |
540 | bool needwake; | 540 | bool needwake; |