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

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20260504-fix-sparse-v1-1-1071137cd280@chromium.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Ricardo Ribalda 2026-05-04 10:55:03 +00:00 committed by Dmitry Torokhov
parent cde5e7777f
commit e7b91b2175

View File

@ -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;