Hid: wacom: Fix kernel test robot warning
Subsystems (2)
PATCH 1/1 Hid: wacom: Fix kernel test robot warning
From: Joshua-Dickens <[email protected]>
Kernel test robot throws the following warning -
Quoted 1 line
Quoted 1 line
drivers/hid/wacom_wac.c:2411:42: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
hid_warn(hdev, "Dropped %hu packets", value - wacom_wac->hid_data.sequence_number);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%dExplicitly casting the argument to unsigned short to silence the warning and retain the intended behavior.
--- drivers/hid/wacom_wac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_wac.c +1 -1
@@ -2408,7 +2408,7 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *fieldreturn ;case WACOM_HID_WD_SEQUENCENUMBER :if (wacom_wac->hid_data.sequence_number != value) -hid_warn (hdev,"Dropped %hu packets" , value - wacom_wac->hid_data.sequence_number); +hid_warn (hdev,"Dropped %hu packets" , (unsigned short )(value - wacom_wac->hid_data.sequence_number)); wacom_wac->hid_data.sequence_number = value +1 ;return ; }
Signature · 1 line
2.35.1
Jiri Kosina
maintainerQuoted 21 lines · Joshua Dickens
From: Joshua-Dickens <[email protected]>
Kernel test robot throws the following warning -
Quoted 1 line
Quoted 1 line
drivers/hid/wacom_wac.c:2411:42: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]hid_warn(hdev, "Dropped %hu packets", value - wacom_wac->hid_data.sequence_number); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %dExplicitly casting the argument to unsigned short to silence the warning and retain the intended behavior.
Reported-by kernel test robot <[email protected]>Signed-off-by Joshua Dickens <[email protected]>--- drivers/hid/wacom_wac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/wacom_wac.c +0
-0
drivers/hid/wacom_wac.c static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field · line 2413
Quoted 7 lines
drivers/hid/wacom_wac.c +1
-1@@ -2408,7 +2408,7 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *fieldreturn ;case WACOM_HID_WD_SEQUENCENUMBER :if (wacom_wac->hid_data.sequence_number != value) -hid_warn (hdev,"Dropped %hu packets" , value - wacom_wac->hid_data.sequence_number); +hid_warn (hdev,"Dropped %hu packets" , (unsigned short )(value - wacom_wac->hid_data.sequence_number)); wacom_wac->hid_data.sequence_number = value +1 ;return ;
Applied on top of the pile in for-5.19/wacom, thanks Joshua.
Signature · 2 lines
Jiri Kosina SUSE Labs