Commit 9b2619aff0332e95ea5eb7a0d75b0208818d871c
Committed by
Ingo Molnar
1 parent
1eba8f8438
Exists in
master
and in
4 other branches
rcu: Clean up code to address Ingo's checkpatch feedback
Move declarations and update storage classes to make checkpatch happy. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: akpm@linux-foundation.org Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com LKML-Reference: <12537246441701-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 6 changed files with 37 additions and 37 deletions Side-by-side Diff
include/linux/rcutree.h
... | ... | @@ -30,10 +30,14 @@ |
30 | 30 | #ifndef __LINUX_RCUTREE_H |
31 | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | |
33 | +struct notifier_block; | |
34 | + | |
33 | 35 | extern void rcu_sched_qs(int cpu); |
34 | 36 | extern void rcu_bh_qs(int cpu); |
35 | - | |
37 | +extern int rcu_cpu_notify(struct notifier_block *self, | |
38 | + unsigned long action, void *hcpu); | |
36 | 39 | extern int rcu_needs_cpu(int cpu); |
40 | +extern int rcu_expedited_torture_stats(char *page); | |
37 | 41 | |
38 | 42 | #ifdef CONFIG_TREE_PREEMPT_RCU |
39 | 43 |
kernel/rcupdate.c
... | ... | @@ -259,9 +259,6 @@ |
259 | 259 | wake_up(&rcu_migrate_wq); |
260 | 260 | } |
261 | 261 | |
262 | -extern int rcu_cpu_notify(struct notifier_block *self, | |
263 | - unsigned long action, void *hcpu); | |
264 | - | |
265 | 262 | static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self, |
266 | 263 | unsigned long action, void *hcpu) |
267 | 264 | { |
kernel/rcutorture.c
... | ... | @@ -606,8 +606,6 @@ |
606 | 606 | .name = "sched_sync" |
607 | 607 | }; |
608 | 608 | |
609 | -extern int rcu_expedited_torture_stats(char *page); | |
610 | - | |
611 | 609 | static struct rcu_torture_ops sched_expedited_ops = { |
612 | 610 | .init = rcu_sync_torture_init, |
613 | 611 | .cleanup = NULL, |
... | ... | @@ -650,7 +648,7 @@ |
650 | 648 | old_rp = rcu_torture_current; |
651 | 649 | rp->rtort_mbtest = 1; |
652 | 650 | rcu_assign_pointer(rcu_torture_current, rp); |
653 | - smp_wmb(); | |
651 | + smp_wmb(); /* Mods to old_rp must follow rcu_assign_pointer() */ | |
654 | 652 | if (old_rp) { |
655 | 653 | i = old_rp->rtort_pipe_count; |
656 | 654 | if (i > RCU_TORTURE_PIPE_LEN) |
kernel/rcutree.c
... | ... | @@ -81,29 +81,6 @@ |
81 | 81 | struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state); |
82 | 82 | DEFINE_PER_CPU(struct rcu_data, rcu_bh_data); |
83 | 83 | |
84 | -/* Forward declarations for rcutree_plugin.h */ | |
85 | -static inline void rcu_bootup_announce(void); | |
86 | -long rcu_batches_completed(void); | |
87 | -static void rcu_preempt_note_context_switch(int cpu); | |
88 | -static int rcu_preempted_readers(struct rcu_node *rnp); | |
89 | -#ifdef CONFIG_RCU_CPU_STALL_DETECTOR | |
90 | -static void rcu_print_task_stall(struct rcu_node *rnp); | |
91 | -#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | |
92 | -static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); | |
93 | -#ifdef CONFIG_HOTPLUG_CPU | |
94 | -static void rcu_preempt_offline_tasks(struct rcu_state *rsp, | |
95 | - struct rcu_node *rnp, | |
96 | - struct rcu_data *rdp); | |
97 | -static void rcu_preempt_offline_cpu(int cpu); | |
98 | -#endif /* #ifdef CONFIG_HOTPLUG_CPU */ | |
99 | -static void rcu_preempt_check_callbacks(int cpu); | |
100 | -static void rcu_preempt_process_callbacks(void); | |
101 | -void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | |
102 | -static int rcu_preempt_pending(int cpu); | |
103 | -static int rcu_preempt_needs_cpu(int cpu); | |
104 | -static void __cpuinit rcu_preempt_init_percpu_data(int cpu); | |
105 | -static void __init __rcu_init_preempt(void); | |
106 | - | |
107 | 84 | |
108 | 85 | /* |
109 | 86 | * Return true if an RCU grace period is in progress. The ACCESS_ONCE()s |
kernel/rcutree.h
... | ... | @@ -270,5 +270,30 @@ |
270 | 270 | DECLARE_PER_CPU(struct rcu_data, rcu_preempt_data); |
271 | 271 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
272 | 272 | |
273 | -#endif /* #ifdef RCU_TREE_NONCORE */ | |
273 | +#else /* #ifdef RCU_TREE_NONCORE */ | |
274 | + | |
275 | +/* Forward declarations for rcutree_plugin.h */ | |
276 | +static inline void rcu_bootup_announce(void); | |
277 | +long rcu_batches_completed(void); | |
278 | +static void rcu_preempt_note_context_switch(int cpu); | |
279 | +static int rcu_preempted_readers(struct rcu_node *rnp); | |
280 | +#ifdef CONFIG_RCU_CPU_STALL_DETECTOR | |
281 | +static void rcu_print_task_stall(struct rcu_node *rnp); | |
282 | +#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | |
283 | +static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); | |
284 | +#ifdef CONFIG_HOTPLUG_CPU | |
285 | +static void rcu_preempt_offline_tasks(struct rcu_state *rsp, | |
286 | + struct rcu_node *rnp, | |
287 | + struct rcu_data *rdp); | |
288 | +static void rcu_preempt_offline_cpu(int cpu); | |
289 | +#endif /* #ifdef CONFIG_HOTPLUG_CPU */ | |
290 | +static void rcu_preempt_check_callbacks(int cpu); | |
291 | +static void rcu_preempt_process_callbacks(void); | |
292 | +void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | |
293 | +static int rcu_preempt_pending(int cpu); | |
294 | +static int rcu_preempt_needs_cpu(int cpu); | |
295 | +static void __cpuinit rcu_preempt_init_percpu_data(int cpu); | |
296 | +static void __init __rcu_init_preempt(void); | |
297 | + | |
298 | +#endif /* #else #ifdef RCU_TREE_NONCORE */ |
kernel/rcutree_trace.c
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | return single_open(file, show_rcudata, NULL); |
94 | 94 | } |
95 | 95 | |
96 | -static struct file_operations rcudata_fops = { | |
96 | +static const struct file_operations rcudata_fops = { | |
97 | 97 | .owner = THIS_MODULE, |
98 | 98 | .open = rcudata_open, |
99 | 99 | .read = seq_read, |
... | ... | @@ -145,7 +145,7 @@ |
145 | 145 | return single_open(file, show_rcudata_csv, NULL); |
146 | 146 | } |
147 | 147 | |
148 | -static struct file_operations rcudata_csv_fops = { | |
148 | +static const struct file_operations rcudata_csv_fops = { | |
149 | 149 | .owner = THIS_MODULE, |
150 | 150 | .open = rcudata_csv_open, |
151 | 151 | .read = seq_read, |
... | ... | @@ -159,7 +159,7 @@ |
159 | 159 | struct rcu_node *rnp; |
160 | 160 | |
161 | 161 | seq_printf(m, "c=%ld g=%ld s=%d jfq=%ld j=%x " |
162 | - "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n", | |
162 | + "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n", | |
163 | 163 | rsp->completed, rsp->gpnum, rsp->signaled, |
164 | 164 | (long)(rsp->jiffies_force_qs - jiffies), |
165 | 165 | (int)(jiffies & 0xffff), |
... | ... | @@ -196,7 +196,7 @@ |
196 | 196 | return single_open(file, show_rcuhier, NULL); |
197 | 197 | } |
198 | 198 | |
199 | -static struct file_operations rcuhier_fops = { | |
199 | +static const struct file_operations rcuhier_fops = { | |
200 | 200 | .owner = THIS_MODULE, |
201 | 201 | .open = rcuhier_open, |
202 | 202 | .read = seq_read, |
... | ... | @@ -222,7 +222,7 @@ |
222 | 222 | return single_open(file, show_rcugp, NULL); |
223 | 223 | } |
224 | 224 | |
225 | -static struct file_operations rcugp_fops = { | |
225 | +static const struct file_operations rcugp_fops = { | |
226 | 226 | .owner = THIS_MODULE, |
227 | 227 | .open = rcugp_open, |
228 | 228 | .read = seq_read, |
... | ... | @@ -276,7 +276,7 @@ |
276 | 276 | return single_open(file, show_rcu_pending, NULL); |
277 | 277 | } |
278 | 278 | |
279 | -static struct file_operations rcu_pending_fops = { | |
279 | +static const struct file_operations rcu_pending_fops = { | |
280 | 280 | .owner = THIS_MODULE, |
281 | 281 | .open = rcu_pending_open, |
282 | 282 | .read = seq_read, |