* [PATCH -next] leds: cht-wcove: Fix an unsigned comparison which can never be negative
@ 2023-05-31 2:02 Yang Li
2023-06-08 16:38 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2023-05-31 2:02 UTC (permalink / raw)
To: pavel; +Cc: lee, linux-leds, linux-kernel, Yang Li, Abaci Robot
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>
---
drivers/leds/leds-cht-wcove.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c
index 0cfebee98910..10afd03164b4 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);
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] leds: cht-wcove: Fix an unsigned comparison which can never be negative
2023-05-31 2:02 [PATCH -next] leds: cht-wcove: Fix an unsigned comparison which can never be negative Yang Li
@ 2023-06-08 16:38 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-06-08 16:38 UTC (permalink / raw)
To: Yang Li; +Cc: pavel, linux-leds, linux-kernel, Abaci Robot
On Wed, 31 May 2023, Yang Li wrote:
> 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>
> ---
> drivers/leds/leds-cht-wcove.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Applied, thanks
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-08 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 2:02 [PATCH -next] leds: cht-wcove: Fix an unsigned comparison which can never be negative Yang Li
2023-06-08 16:38 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).