summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Ionichev <sozdayvek@gmail.com>2026-05-10 03:36:32 +0300
committerLee Jones <lee@kernel.org>2026-06-17 13:28:59 +0300
commitd0316c89636d72a8a6766e82453570f7bd003b21 (patch)
tree59cff8d21a8f53f8a6cc09094d80f1fc362efbe3
parent2682d6308654850ee4d4f9b3bbe3a31417890594 (diff)
downloadlinux-d0316c89636d72a8a6766e82453570f7bd003b21.tar.xz
leds: dac124s085: Declare SPI command word as __le16
dac124s085_set_brightness() builds a 16-bit SPI command word: u16 word; ... word = cpu_to_le16(((led->id) << 14) | REG_WRITE_UPDATE | (brightness & 0xfff)); ret = spi_write(led->spi, (const u8 *)&word, sizeof(word)); cpu_to_le16() returns __le16, but the local 'word' is declared as plain u16, which sparse flags: drivers/leds/leds-dac124s085.c:42:14: warning: incorrect type in assignment (different base types) The bytes that hit the wire are correct because cpu_to_le16() does the right thing on either endianness, but mixing the annotated and unannotated types defeats sparse's __bitwise checking and would let a future reader treat the buffer as a host-endian u16 by mistake. Declare 'word' as __le16 to match how it is built and consumed. No functional change. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Link: https://patch.msgid.link/20260510003632.35942-1-sozdayvek@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--drivers/leds/leds-dac124s085.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-dac124s085.c b/drivers/leds/leds-dac124s085.c
index cf5fb1195f87..192b43333aee 100644
--- a/drivers/leds/leds-dac124s085.c
+++ b/drivers/leds/leds-dac124s085.c
@@ -35,7 +35,7 @@ static int dac124s085_set_brightness(struct led_classdev *ldev,
{
struct dac124s085_led *led = container_of(ldev, struct dac124s085_led,
ldev);
- u16 word;
+ __le16 word;
int ret;
mutex_lock(&led->mutex);