summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNathan Lynch <nathanl@linux.ibm.com>2023-02-10 19:41:57 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2023-02-13 12:35:02 +0100
commit77f85f69a97ac5f24537261a893436926c3e0cdc (patch)
treecfa3f3d5b5067d7f838259989d0e817b1059d821 /arch/powerpc
parentpowerpc/rtas: improve function information lookups (diff)
downloadlinux-77f85f69a97ac5f24537261a893436926c3e0cdc.tar.xz
linux-77f85f69a97ac5f24537261a893436926c3e0cdc.zip
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 <nathanl@linux.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230125-b4-powerpc-rtas-queue-v3-9-26929c8cce78@linux.ibm.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/rtas.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 3c7151f4f2ba..d2622b997b68 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -523,7 +523,7 @@ static const struct rtas_function *rtas_token_to_function(s32 token)
/* This is here deliberately so it's only used in this file */
void enter_rtas(unsigned long);
-static inline void do_enter_rtas(unsigned long args)
+static void do_enter_rtas(struct rtas_args *args)
{
unsigned long msr;
@@ -538,7 +538,7 @@ static inline void do_enter_rtas(unsigned long args)
hard_irq_disable(); /* Ensure MSR[EE] is disabled on PPC64 */
- enter_rtas(args);
+ enter_rtas(__pa(args));
srr_regs_clobbered(); /* rtas uses SRRs, invalidate */
}
@@ -892,7 +892,7 @@ static char *__fetch_rtas_last_error(char *altbuf)
save_args = rtas_args;
rtas_args = err_args;
- do_enter_rtas(__pa(&rtas_args));
+ do_enter_rtas(&rtas_args);
err_args = rtas_args;
rtas_args = save_args;
@@ -939,7 +939,7 @@ va_rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret,
for (i = 0; i < nret; ++i)
args->rets[i] = 0;
- do_enter_rtas(__pa(args));
+ do_enter_rtas(args);
}
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)
raw_spin_lock_irqsave(&rtas_lock, flags);
rtas_args = args;
- do_enter_rtas(__pa(&rtas_args));
+ do_enter_rtas(&rtas_args);
args = rtas_args;
/* A -1 return code indicates that the last command couldn't