Skip to content

Commit 0f541cc

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/smp: use call_on_stack() macro
Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 845370f commit 0f541cc

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

arch/s390/kernel/smp.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,24 +300,28 @@ static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data)
300300
pcpu_sigp_retry(pcpu, SIGP_RESTART, 0);
301301
}
302302

303+
typedef void (pcpu_delegate_fn)(void *);
304+
303305
/*
304306
* Call function via PSW restart on pcpu and stop the current cpu.
305307
*/
306-
static void __pcpu_delegate(void (*func)(void*), void *data)
308+
static void __pcpu_delegate(pcpu_delegate_fn *func, void *data)
307309
{
308310
func(data); /* should not return */
309311
}
310312

311313
static void __no_sanitize_address pcpu_delegate(struct pcpu *pcpu,
312-
void (*func)(void *),
314+
pcpu_delegate_fn *func,
313315
void *data, unsigned long stack)
314316
{
315317
struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices];
316318
unsigned long source_cpu = stap();
317319

318320
__load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT);
319-
if (pcpu->address == source_cpu)
320-
CALL_ON_STACK(__pcpu_delegate, stack, 2, func, data);
321+
if (pcpu->address == source_cpu) {
322+
call_on_stack(2, stack, void, __pcpu_delegate,
323+
pcpu_delegate_fn *, func, void *, data);
324+
}
321325
/* Stop target cpu (if func returns this stops the current cpu). */
322326
pcpu_sigp_retry(pcpu, SIGP_STOP, 0);
323327
/* Restart func on the target cpu and stop the current cpu. */

0 commit comments

Comments
 (0)