]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Fix unsigned comparison with less than zero
authorYang Li <yang.lee@linux.alibaba.com>
Sat, 6 Aug 2022 07:19:33 +0000 (15:19 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 12 Aug 2022 05:10:10 +0000 (13:10 +0800)
commitc5541859de874607462ac41a3d1ba8b1f7f64cf4
tree81d34240c716b9574f1c54a67f880faea300106f
parentd27212f2cd90300ee97d108670c2645f40f35621
LoongArch: Fix unsigned comparison with less than zero

The return value from the call to get_timer_irq() is int, which can be
a negative error code. However, the return value is being assigned to an
unsigned int variable 'irq', so making 'irq' an int.

Eliminate the following coccicheck warning:
./arch/loongarch/kernel/time.c:146:5-8: WARNING: Unsigned expression compared with zero: irq < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/time.c