aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Wegener <sven.wegener@stealer.net>2021-06-12 21:56:21 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-09-11 20:26:41 +0100
commite9a22ce2535c4a0faf83d5595304fe0e2c7bd1b2 (patch)
tree7fe064f870f70d0a18a3e615b9223d7e14febda2
parentc4f9f9b44c82ffeacd9d3c00ba07171c35831337 (diff)
downloadupstream-e9a22ce2535c4a0faf83d5595304fe0e2c7bd1b2.tar.gz
upstream-e9a22ce2535c4a0faf83d5595304fe0e2c7bd1b2.tar.bz2
upstream-e9a22ce2535c4a0faf83d5595304fe0e2c7bd1b2.zip
mediatek: cast literal value to char
Or the comparison against a signed char is always true, because the literal 0xaa is treated as an unsigned int, to which the signed char is casted during comparison. 0xaa is above the positive values of a signed char and negative signed char values result in values larger than 0xaa when casted to unsigned int. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
-rw-r--r--target/linux/mediatek/files/drivers/leds/leds-ubnt-ledbar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/mediatek/files/drivers/leds/leds-ubnt-ledbar.c b/target/linux/mediatek/files/drivers/leds/leds-ubnt-ledbar.c
index 9bfe0e62f4..8168391d7e 100644
--- a/target/linux/mediatek/files/drivers/leds/leds-ubnt-ledbar.c
+++ b/target/linux/mediatek/files/drivers/leds/leds-ubnt-ledbar.c
@@ -26,7 +26,7 @@
#define UBNT_LEDBAR_MAX_BRIGHTNESS 0xff
#define UBNT_LEDBAR_TRANSACTION_LENGTH 8
-#define UBNT_LEDBAR_TRANSACTION_SUCCESS 0xaa
+#define UBNT_LEDBAR_TRANSACTION_SUCCESS (char) 0xaa
#define UBNT_LEDBAR_TRANSACTION_BLUE_IDX 2
#define UBNT_LEDBAR_TRANSACTION_GREEN_IDX 3