Commit 580c11cd authored by Nam Cao's avatar Nam Cao Committed by Paul Walmsley
Browse files

riscv: kprobes: Remove duplication of RVC_EXTRACT_C2_RS1_REG



Use RVC_EXTRACT_C2_RS1_REG, instead of reimplementing it in
simulate_c_jr_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/d56955cd683411c6d2f63d13c78e0572462a3269.1747215274.git.namcao@linutronix.de/


Signed-off-by: default avatarPaul Walmsley <pjw@kernel.org>
parent 05ede658
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static bool __kprobes simulate_c_jr_jalr(u32 opcode, unsigned long addr, struct

	unsigned long jump_addr;

	u32 rs1 = (opcode >> 7) & 0x1f;
	u32 rs1 = RVC_EXTRACT_C2_RS1_REG(opcode);

	if (rs1 == 0) /* C.JR is only valid when rs1 != x0 */
		return false;