Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: cht-wcove: Fix an unsigned comparison which can never be negative

The return value from the call to cht_wc_leds_find_freq() is int.
However, the return value is being assigned to an unsigned
int variable 'ctrl', so making it an int.

Eliminate the following warning:
drivers/leds/leds-cht-wcove.c:236 cht_wc_leds_set_effect() warn: unsigned 'ctrl' is never less than zero.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5341
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230531020238.102684-1-yang.lee@linux.alibaba.com

authored by

Yang Li and committed by
Lee Jones
de416a9f 3f80ba44

+1 -2
+1 -2
drivers/leds/leds-cht-wcove.c
··· 223 223 u8 effect) 224 224 { 225 225 struct cht_wc_led *led = container_of(cdev, struct cht_wc_led, cdev); 226 - unsigned int ctrl; 227 - int ret; 226 + int ctrl, ret; 228 227 229 228 mutex_lock(&led->mutex); 230 229