summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/fault.c
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2020-05-06 05:40:28 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-18 16:10:37 +0200
commit8094892d1aff14269d3b7bfcd8b941217eecd81f (patch)
treefe2937db7a5e26b5bc496ca3f6d94794e644f23d /arch/powerpc/mm/fault.c
parentpowerpc: Use an accessor for instructions (diff)
downloadlinux-8094892d1aff14269d3b7bfcd8b941217eecd81f.tar.xz
linux-8094892d1aff14269d3b7bfcd8b941217eecd81f.zip
powerpc: Use a function for getting the instruction op code
In preparation for using a data type for instructions that can not be directly used with the '>>' operator use a function for getting the op code of an instruction. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Reviewed-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200506034050.24806-9-jniethe5@gmail.com
Diffstat (limited to '')
-rw-r--r--arch/powerpc/mm/fault.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index cec8f7e46941..2c23c3076b1e 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -41,6 +41,7 @@
#include <asm/siginfo.h>
#include <asm/debug.h>
#include <asm/kup.h>
+#include <asm/inst.h>
/*
* Check whether the instruction inst is a store using
@@ -52,7 +53,7 @@ static bool store_updates_sp(unsigned int inst)
if (((ppc_inst_val(inst) >> 16) & 0x1f) != 1)
return false;
/* check major opcode */
- switch (inst >> 26) {
+ switch (ppc_inst_primary_opcode(inst)) {
case OP_STWU:
case OP_STBU:
case OP_STHU: