Skip to content

Commit c838b58

Browse files
committed
MIPS: jump_label: Remove redundant nops
Both arch_static_branch() & arch_static_branch_jump() emit a control transfer instruction (ie. branch or jump) without disabling assembler re-ordering. As such the assembler will automatically fill their delay slots. Both functions follow their branch or jump with an explicit nop that at first appears to be there to fill the delay slot, but given that the assembler will do that the explicit nops serve no purpose & we end up with our branch or jump followed by 2 nops. Remove the redundant nops. Signed-off-by: Paul Burton <[email protected]> Cc: [email protected]
1 parent ec86e54 commit c838b58

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/mips/include/asm/jump_label.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
3030
{
3131
asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
32-
"2:\tnop\n\t"
32+
"2:\t.insn\n\t"
3333
".pushsection __jump_table, \"aw\"\n\t"
3434
WORD_INSN " 1b, %l[l_yes], %0\n\t"
3535
".popsection\n\t"
@@ -43,7 +43,6 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
4343
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
4444
{
4545
asm_volatile_goto("1:\tj %l[l_yes]\n\t"
46-
"nop\n\t"
4746
".pushsection __jump_table, \"aw\"\n\t"
4847
WORD_INSN " 1b, %l[l_yes], %0\n\t"
4948
".popsection\n\t"

0 commit comments

Comments
 (0)