Skip to content

Commit 77f85f6

Browse files
nathanlynchmpe
authored andcommitted
powerpc/rtas: strengthen do_enter_rtas() type safety, drop inline
Make do_enter_rtas() take a pointer to struct rtas_args and do the __pa() conversion in one place instead of leaving it to callers. This also makes it possible to introduce enter/exit tracepoints that access the rtas_args struct fields. There's no apparent reason to force inlining of do_enter_rtas() either, and it seems to bloat the code a bit. Let the compiler decide. Signed-off-by: Nathan Lynch <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Reviewed-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8252b88 commit 77f85f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static const struct rtas_function *rtas_token_to_function(s32 token)
523523
/* This is here deliberately so it's only used in this file */
524524
void enter_rtas(unsigned long);
525525

526-
static inline void do_enter_rtas(unsigned long args)
526+
static void do_enter_rtas(struct rtas_args *args)
527527
{
528528
unsigned long msr;
529529

@@ -538,7 +538,7 @@ static inline void do_enter_rtas(unsigned long args)
538538

539539
hard_irq_disable(); /* Ensure MSR[EE] is disabled on PPC64 */
540540

541-
enter_rtas(args);
541+
enter_rtas(__pa(args));
542542

543543
srr_regs_clobbered(); /* rtas uses SRRs, invalidate */
544544
}
@@ -892,7 +892,7 @@ static char *__fetch_rtas_last_error(char *altbuf)
892892
save_args = rtas_args;
893893
rtas_args = err_args;
894894

895-
do_enter_rtas(__pa(&rtas_args));
895+
do_enter_rtas(&rtas_args);
896896

897897
err_args = rtas_args;
898898
rtas_args = save_args;
@@ -939,7 +939,7 @@ va_rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret,
939939
for (i = 0; i < nret; ++i)
940940
args->rets[i] = 0;
941941

942-
do_enter_rtas(__pa(args));
942+
do_enter_rtas(args);
943943
}
944944

945945
void rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret, ...)
@@ -1757,7 +1757,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
17571757
raw_spin_lock_irqsave(&rtas_lock, flags);
17581758

17591759
rtas_args = args;
1760-
do_enter_rtas(__pa(&rtas_args));
1760+
do_enter_rtas(&rtas_args);
17611761
args = rtas_args;
17621762

17631763
/* A -1 return code indicates that the last command couldn't

0 commit comments

Comments
 (0)