[IA64] smp.c coding style fix
Fix indenting of switch statement to follow CodingStyle, and pull out handling of call_data into an inlined function. I confirmed that applying this fix doesn't affect assembled code. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
committed by
Tony Luck
parent
6d3c511108
commit
c0cd661b1b
@@ -98,8 +98,33 @@ unlock_ipi_calllock(void)
|
|||||||
spin_unlock_irq(&call_lock);
|
spin_unlock_irq(&call_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
handle_call_data(void)
|
||||||
|
{
|
||||||
|
struct call_data_struct *data;
|
||||||
|
void (*func)(void *info);
|
||||||
|
void *info;
|
||||||
|
int wait;
|
||||||
|
|
||||||
|
/* release the 'pointer lock' */
|
||||||
|
data = (struct call_data_struct *)call_data;
|
||||||
|
func = data->func;
|
||||||
|
info = data->info;
|
||||||
|
wait = data->wait;
|
||||||
|
|
||||||
|
mb();
|
||||||
|
atomic_inc(&data->started);
|
||||||
|
/* At this point the structure may be gone unless wait is true. */
|
||||||
|
(*func)(info);
|
||||||
|
|
||||||
|
/* Notify the sending CPU that the task is done. */
|
||||||
|
mb();
|
||||||
|
if (wait)
|
||||||
|
atomic_inc(&data->finished);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stop_this_cpu (void)
|
stop_this_cpu(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Remove this CPU:
|
* Remove this CPU:
|
||||||
@@ -138,44 +163,21 @@ handle_IPI (int irq, void *dev_id)
|
|||||||
ops &= ~(1 << which);
|
ops &= ~(1 << which);
|
||||||
|
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case IPI_CALL_FUNC:
|
case IPI_CALL_FUNC:
|
||||||
{
|
handle_call_data();
|
||||||
struct call_data_struct *data;
|
break;
|
||||||
void (*func)(void *info);
|
|
||||||
void *info;
|
|
||||||
int wait;
|
|
||||||
|
|
||||||
/* release the 'pointer lock' */
|
case IPI_CPU_STOP:
|
||||||
data = (struct call_data_struct *) call_data;
|
|
||||||
func = data->func;
|
|
||||||
info = data->info;
|
|
||||||
wait = data->wait;
|
|
||||||
|
|
||||||
mb();
|
|
||||||
atomic_inc(&data->started);
|
|
||||||
/*
|
|
||||||
* At this point the structure may be gone unless
|
|
||||||
* wait is true.
|
|
||||||
*/
|
|
||||||
(*func)(info);
|
|
||||||
|
|
||||||
/* Notify the sending CPU that the task is done. */
|
|
||||||
mb();
|
|
||||||
if (wait)
|
|
||||||
atomic_inc(&data->finished);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IPI_CPU_STOP:
|
|
||||||
stop_this_cpu();
|
stop_this_cpu();
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_KEXEC
|
#ifdef CONFIG_KEXEC
|
||||||
case IPI_KDUMP_CPU_STOP:
|
case IPI_KDUMP_CPU_STOP:
|
||||||
unw_init_running(kdump_cpu_freeze, NULL);
|
unw_init_running(kdump_cpu_freeze, NULL);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n", this_cpu, which);
|
printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n",
|
||||||
|
this_cpu, which);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (ops);
|
} while (ops);
|
||||||
|
Reference in New Issue
Block a user