Commit c8def554d031664e984323f6a5d667f070717776
Committed by
Linus Torvalds
1 parent
723aae25d5
Exists in
master
and in
20 other branches
smp_call_function_interrupt: use typedef and %pf
Use the newly added smp_call_func_t in smp_call_function_interrupt for the func variable, and make the comment above the WARN more assertive and explicit. Also, func is a function pointer and does not need an offset, so use %pf not %pS. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff
kernel/smp.c
... | ... | @@ -194,7 +194,7 @@ |
194 | 194 | */ |
195 | 195 | list_for_each_entry_rcu(data, &call_function.queue, csd.list) { |
196 | 196 | int refs; |
197 | - void (*func) (void *info); | |
197 | + smp_call_func_t func; | |
198 | 198 | |
199 | 199 | /* |
200 | 200 | * Since we walk the list without any locks, we might |
201 | 201 | |
202 | 202 | |
... | ... | @@ -214,17 +214,17 @@ |
214 | 214 | if (atomic_read(&data->refs) == 0) |
215 | 215 | continue; |
216 | 216 | |
217 | - func = data->csd.func; /* for later warn */ | |
218 | - data->csd.func(data->csd.info); | |
217 | + func = data->csd.func; /* save for later warn */ | |
218 | + func(data->csd.info); | |
219 | 219 | |
220 | 220 | /* |
221 | - * If the cpu mask is not still set then it enabled interrupts, | |
222 | - * we took another smp interrupt, and executed the function | |
223 | - * twice on this cpu. In theory that copy decremented refs. | |
221 | + * If the cpu mask is not still set then func enabled | |
222 | + * interrupts (BUG), and this cpu took another smp call | |
223 | + * function interrupt and executed func(info) twice | |
224 | + * on this cpu. That nested execution decremented refs. | |
224 | 225 | */ |
225 | 226 | if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) { |
226 | - WARN(1, "%pS enabled interrupts and double executed\n", | |
227 | - func); | |
227 | + WARN(1, "%pf enabled interrupts and double executed\n", func); | |
228 | 228 | continue; |
229 | 229 | } |
230 | 230 |