[2/7] riscv: jump_label: Simplify assembly syntax

Message ID 20240212025529.1971876-3-samuel.holland@sifive.com
State New
Headers
Series riscv: Various text patching improvements |

Commit Message

Samuel Holland Feb. 12, 2024, 2:55 a.m. UTC
  The idiomatic way to write "jal zero" is "j".

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

 arch/riscv/include/asm/jump_label.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Björn Töpel Feb. 19, 2024, 12:27 p.m. UTC | #1
Samuel Holland <samuel.holland@sifive.com> writes:

> The idiomatic way to write "jal zero" is "j".
>
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>

Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
  

Patch

diff --git a/arch/riscv/include/asm/jump_label.h b/arch/riscv/include/asm/jump_label.h
index 6290b26f4a14..1c768d02bd0c 100644
--- a/arch/riscv/include/asm/jump_label.h
+++ b/arch/riscv/include/asm/jump_label.h
@@ -46,7 +46,7 @@  static __always_inline bool arch_static_branch_jump(struct static_key * const ke
 		"	.option push				\n\t"
 		"	.option norelax				\n\t"
 		"	.option norvc				\n\t"
-		"1:	jal		zero, %l[label]		\n\t"
+		"1:	j		%l[label]		\n\t"
 		"	.option pop				\n\t"
 		"	.pushsection	__jump_table, \"aw\"	\n\t"
 		"	.align		" RISCV_LGPTR "		\n\t"