summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2023-05-31 05:02:38 +0300
committerLee Jones <lee@kernel.org>2023-06-08 19:37:51 +0300
commitde416a9f91f330cf764c9d46bb5faac844f4e9ac (patch)
treec3fd07fe6467f488554fcb6c226e0b2138677cd8 /drivers/leds
parent3f80ba4444dc004f5db473439c2f80837cbe85f6 (diff)
downloadlinux-de416a9f91f330cf764c9d46bb5faac844f4e9ac.tar.xz
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
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-cht-wcove.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c
index 0a5c30e5ed5d..42ba44208410 100644
--- a/drivers/leds/leds-cht-wcove.c
+++ b/drivers/leds/leds-cht-wcove.c
@@ -223,8 +223,7 @@ static int cht_wc_leds_set_effect(struct led_classdev *cdev,
u8 effect)
{
struct cht_wc_led *led = container_of(cdev, struct cht_wc_led, cdev);
- unsigned int ctrl;
- int ret;
+ int ctrl, ret;
mutex_lock(&led->mutex);