[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230608171308.GE3572061@google.com>
Date: Thu, 8 Jun 2023 18:13:08 +0100
From: Lee Jones <lee@...nel.org>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc: pavel@....cz, linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org, Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH] leds: flash: leds-qcom-flash: Fix an unsigned comparison
which can never be negative
On Wed, 31 May 2023, Jiapeng Chong wrote:
> The variable 'count' is defined as unsigned type, so the following if
> statement is invalid, we can modify the type of count to int.
> if (count <= 0) {
> dev_err(dev, "No led-sources specified\n");
> return -ENODEV;
> }
>
> ./drivers/leds/flash/leds-qcom-flash.c:546:5-10: WARNING: Unsigned expression compared with zero: count <= 0.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5344
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
> drivers/leds/flash/leds-qcom-flash.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists