Commit c8def554 authored by Milton Miller's avatar Milton Miller Committed by Linus Torvalds

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: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 723aae25
...@@ -194,7 +194,7 @@ void generic_smp_call_function_interrupt(void) ...@@ -194,7 +194,7 @@ void generic_smp_call_function_interrupt(void)
*/ */
list_for_each_entry_rcu(data, &call_function.queue, csd.list) { list_for_each_entry_rcu(data, &call_function.queue, csd.list) {
int refs; int refs;
void (*func) (void *info); smp_call_func_t func;
/* /*
* Since we walk the list without any locks, we might * Since we walk the list without any locks, we might
...@@ -214,17 +214,17 @@ void generic_smp_call_function_interrupt(void) ...@@ -214,17 +214,17 @@ void generic_smp_call_function_interrupt(void)
if (atomic_read(&data->refs) == 0) if (atomic_read(&data->refs) == 0)
continue; continue;
func = data->csd.func; /* for later warn */ func = data->csd.func; /* save for later warn */
data->csd.func(data->csd.info); func(data->csd.info);
/* /*
* If the cpu mask is not still set then it enabled interrupts, * If the cpu mask is not still set then func enabled
* we took another smp interrupt, and executed the function * interrupts (BUG), and this cpu took another smp call
* twice on this cpu. In theory that copy decremented refs. * function interrupt and executed func(info) twice
* on this cpu. That nested execution decremented refs.
*/ */
if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) { if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) {
WARN(1, "%pS enabled interrupts and double executed\n", WARN(1, "%pf enabled interrupts and double executed\n", func);
func);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment