Commit 4d4a3cc7 authored by Nam Cao's avatar Nam Cao Committed by Paul Walmsley
Browse files

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: default avatarNam Cao <namcao@linutronix.de>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/linux-riscv/8ae34e966c312ae5cf6c09a35ddc290cce942208.1747215274.git.namcao@linutronix.de/


Signed-off-by: default avatarPaul Walmsley <pjw@kernel.org>
parent 7843b48d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ bool __kprobes simulate_jalr(u32 opcode, unsigned long addr, struct pt_regs *reg
	 */
	bool ret;
	unsigned long base_addr;
	u32 imm = (opcode >> 20) & 0xfff;
	u32 imm = RV_EXTRACT_ITYPE_IMM(opcode);
	u32 rd_index = RV_EXTRACT_RD_REG(opcode);
	u32 rs1_index = RV_EXTRACT_RS1_REG(opcode);