提交 b4fb88d6 编写于 作者: Y Yang Li 提交者: Hongchen Zhang

LoongArch: Fix unsigned comparison with less than zero

mainline inclusion
from mainline-v6.0-rc1
commit aafcac81
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
CVE: NA

--------------------------------

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: NAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: NYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
上级 0bfb2391
......@@ -135,7 +135,7 @@ static int get_timer_irq(void)
int constant_clockevent_init(void)
{
unsigned int irq;
int irq;
unsigned int cpu = smp_processor_id();
unsigned long min_delta = 0x600;
unsigned long max_delta = (1UL << 48) - 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册