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

leds: leds-lp3944, fix "sparse" warning "mixing different enum types"

Fix a warning from "sparse":

drivers/leds/leds-lp3944.c:292:23: warning: mixing different enum types
drivers/leds/leds-lp3944.c:292:23: int enum led_brightness versus
drivers/leds/leds-lp3944.c:292:23: int enum lp3944_status

Keeping track of LP3944_LED_STATUS_OFF and LP3944_LED_STATUS_ON only in
lp3944_led_set_brightness() is OK, as the handling of DIM (blinking)
mode[s] is in lp3944_led_set_blink().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

authored by

Antonio Ospite and committed by
Bryan Wu
29ab311c 2e87c092

+1 -1
+1 -1
drivers/leds/leds-lp3944.c
··· 289 289 dev_dbg(&led->client->dev, "%s: %s, %d\n", 290 290 __func__, led_cdev->name, brightness); 291 291 292 - led->status = brightness; 292 + led->status = !!brightness; 293 293 schedule_work(&led->work); 294 294 } 295 295