Skip to content

Commit 7af43a7

Browse files
Chen ZhouLee Jones
authored andcommitted
backlight: qcom-wled: Fix unsigned comparison to zero
Fixes coccicheck warning: ./drivers/video/backlight/qcom-wled.c:1104:5-15: WARNING: Unsigned expression compared with zero: string_len > 0 The unsigned variable string_len is assigned a return value from the call to of_property_count_elems_of_size(), which may return negative error code. Fixes: 775d2ff ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Chen Zhou <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Reviewed-by: Kiran Gunda <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent c8fdcc8 commit 7af43a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/video/backlight/qcom-wled.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,8 @@ static int wled_configure(struct wled *wled, int version)
956956
struct wled_config *cfg = &wled->cfg;
957957
struct device *dev = wled->dev;
958958
const __be32 *prop_addr;
959-
u32 size, val, c, string_len;
960-
int rc, i, j;
959+
u32 size, val, c;
960+
int rc, i, j, string_len;
961961

962962
const struct wled_u32_opts *u32_opts = NULL;
963963
const struct wled_u32_opts wled3_opts[] = {

0 commit comments

Comments
 (0)