"Das U-Boot" Source Tree

riscv: simplify longjmp

The value returned by setjmp must be nonzero. If zero is passed as
parameter it must be replaced by 1.

This patch reduces the code size a bit.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

authored by

Heinrich Schuchardt and committed by
Leo Yu-Chi Liang
a718e2ae ae2d9506

+2 -6
+2 -6
arch/riscv/lib/setjmp.S
··· 54 54 LOAD_IDX(sp, 13) 55 55 56 56 /* Move the return value in place, but return 1 if passed 0. */ 57 - beq a1, zero, longjmp_1 58 - mv a0, a1 59 - ret 60 - 61 - longjmp_1: 62 - li a0, 1 57 + seqz a0, a1 58 + add a0, a0, a1 63 59 ret 64 60 ENDPROC(longjmp) 65 61 .popsection