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>
This commit is contained in:
Yang Li 2022-08-06 15:19:33 +08:00 committed by Huacai Chen
parent f30d1f495c
commit aafcac81b0
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ static int get_timer_irq(void)
int constant_clockevent_init(void) int constant_clockevent_init(void)
{ {
unsigned int irq; int irq;
unsigned int cpu = smp_processor_id(); unsigned int cpu = smp_processor_id();
unsigned long min_delta = 0x600; unsigned long min_delta = 0x600;
unsigned long max_delta = (1UL << 48) - 1; unsigned long max_delta = (1UL << 48) - 1;