Skip to contentSkip to conversation

Input: atmel_mxt_ts - Set byte_offset as signed

PATCH Applied Ricardo Ribalda 2 participants 2 messages May 4

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: atmel_mxt_ts - Set byte_offset as signed

The calculations done to obtain byte_offset can result into a negative number, fix its type.

This patch fixes the following sparse error:

drivers/input/touchscreen/atmel_mxt_ts.c:1481:44: warning: unsigned value that used to be signed checked against zero? drivers/input/touchscreen/atmel_mxt_ts.c:1479:49: signed value source

---
 drivers/input/touchscreen/atmel_mxt_ts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/touchscreen/atmel_mxt_ts.c +2 -1
index 87c6a10381f2..26ba82fb60b6 100644
@@ -1397,7 +1397,8 @@ static int mxt_prepare_cfg_mem(struct mxt_data *data, struct mxt_cfg *cfg)
 {
 	struct device *dev = &data->client->dev;
 	struct mxt_object *object;
-	unsigned int type, instance, size, byte_offset;
+	unsigned int type, instance, size;
+	int byte_offset;
 	int offset;
 	int ret;
 	int i;

---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260504-fix-sparse-3bfa6ba62e5b

Best regards,

Signature · 1 line
Ricardo Ribalda <[email protected]>
maintainer Applied
#1 lore raw
Quoted 9 lines · Ricardo Ribalda

The calculations done to obtain byte_offset can result into a negative number, fix its type.

This patch fixes the following sparse error:

drivers/input/touchscreen/atmel_mxt_ts.c:1481:44: warning: unsigned value that used to be signed checked against zero? drivers/input/touchscreen/atmel_mxt_ts.c:1479:49: signed value source

Applied, thank you.

Signature · 1 line
Dmitry