]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
leds: multicolor: Change intensity_value to unsigned int
authorMichael Tretter <m.tretter@pengutronix.de>
Fri, 6 Feb 2026 14:21:23 +0000 (15:21 +0100)
committerLee Jones <lee@kernel.org>
Tue, 10 Mar 2026 09:22:53 +0000 (09:22 +0000)
commitb5227947e68e7515ba449b870338909ed32ac8d2
tree111dbc0e2d179481948946a08d4b82388f931414
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
leds: multicolor: Change intensity_value to unsigned int

Using min to compare the intensity_value with led_dev->max_brightness
causes a signedness error:

drivers/leds/led-class-multicolor.c: In function 'multi_intensity_store':
././include/linux/compiler_types.h:630:45: error:
  call to '__compiletime_assert_195' declared with attribute error:
    min(intensity_value[i], led_cdev->max_brightness) signedness error

Change the type of intensity_value to unsigned int to fix the signedness
error.

intensity_value is used to set mcled_cdev->subled_info[i].intensity,
which is unsigned int, too.

Fixes: 129f82752bce ("leds: multicolor: Limit intensity to max_brightness of LED")
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Link: https://patch.msgid.link/20260206-leds-multicolor-fix-signedness-error-v1-1-48a00ed33c07@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/led-class-multicolor.c