LoongArch: Fix unsigned comparison with less than zero
authorKaiLong Wang <wangkailong@jari.cn>
Mon, 21 Nov 2022 11:02:57 +0000 (19:02 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 21 Nov 2022 11:02:57 +0000 (19:02 +0800)
Eliminate the following coccicheck warning:

./arch/loongarch/kernel/unwind_prologue.c:84:5-13: WARNING: Unsigned
expression compared with zero: frame_ra < 0

Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/unwind_prologue.c

index b206d91592051b6d0da2b0b7ce9d985db4502f7f..4571c3c87cd4c0dc8da5515d82fecd8da1b7397e 100644 (file)
@@ -43,7 +43,8 @@ static bool unwind_by_prologue(struct unwind_state *state)
 {
        struct stack_info *info = &state->stack_info;
        union loongarch_instruction *ip, *ip_end;
-       unsigned long frame_size = 0, frame_ra = -1;
+       long frame_ra = -1;
+       unsigned long frame_size = 0;
        unsigned long size, offset, pc = state->pc;
 
        if (state->sp >= info->end || state->sp < info->begin)