* [PATCH] Hid: wacom: Fix kernel test robot warning
@ 2022-04-30 0:01 Joshua Dickens
2022-05-06 6:37 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Joshua Dickens @ 2022-04-30 0:01 UTC (permalink / raw)
To: linux-input, Jiri Kosina, Benjamin Tissoires
Cc: Ping Cheng, Aaron Armstrong Skomra, Jason Gerecke,
Joshua-Dickens, kernel test robot, Joshua Dickens
From: Joshua-Dickens <Joshua@Joshua-Dickens.com>
Kernel test robot throws the following warning -
>> 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);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%d
Explicitly casting the argument to unsigned short to silence the warning and retain the intended behavior.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Joshua Dickens <joshua.dickens@wacom.com>
---
drivers/hid/wacom_wac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 64fe573deb9b..9470c2b0b529 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2408,7 +2408,7 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field
return;
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;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Hid: wacom: Fix kernel test robot warning
2022-04-30 0:01 [PATCH] Hid: wacom: Fix kernel test robot warning Joshua Dickens
@ 2022-05-06 6:37 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2022-05-06 6:37 UTC (permalink / raw)
To: Joshua Dickens
Cc: linux-input, Benjamin Tissoires, Ping Cheng,
Aaron Armstrong Skomra, Jason Gerecke, kernel test robot,
Joshua Dickens
On Fri, 29 Apr 2022, Joshua Dickens wrote:
> From: Joshua-Dickens <Joshua@Joshua-Dickens.com>
>
> Kernel test robot throws the following warning -
> >> 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);
> ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> %d
>
> Explicitly casting the argument to unsigned short to silence the warning and retain the intended behavior.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Joshua Dickens <joshua.dickens@wacom.com>
> ---
> drivers/hid/wacom_wac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 64fe573deb9b..9470c2b0b529 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -2408,7 +2408,7 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field
> return;
> 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.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-06 6:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 0:01 [PATCH] Hid: wacom: Fix kernel test robot warning Joshua Dickens
2022-05-06 6:37 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.