Skip to content

Commit 4d4a3cc

Browse files
covanamPaul Walmsley
authored andcommitted
riscv: kprobes: Remove duplication of RV_EXTRACT_ITYPE_IMM
Use RV_EXTRACT_ITYPE_IMM, instead of re-implementing it in simulate_jalr(). Signed-off-by: Nam Cao <namcao@linutronix.de> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/linux-riscv/8ae34e966c312ae5cf6c09a35ddc290cce942208.1747215274.git.namcao@linutronix.de/ Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 7843b48 commit 4d4a3cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/probes/simulate-insn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bool __kprobes simulate_jalr(u32 opcode, unsigned long addr, struct pt_regs *reg
6464
*/
6565
bool ret;
6666
unsigned long base_addr;
67-
u32 imm = (opcode >> 20) & 0xfff;
67+
u32 imm = RV_EXTRACT_ITYPE_IMM(opcode);
6868
u32 rd_index = RV_EXTRACT_RD_REG(opcode);
6969
u32 rs1_index = RV_EXTRACT_RS1_REG(opcode);
7070

0 commit comments

Comments
 (0)