Re: [PATCH] HID: i2c-hid: fix format string mismatch

From: Jiri Kosina
Date: Wed May 26 2021 - 06:49:07 EST


On Fri, 14 May 2021, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> clang doesn't like printing a 32-bit integer using %hX format string:
>
> drivers/hid/i2c-hid/i2c-hid-core.c:994:18: error: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Werror,-Wformat]
> client->name, hid->vendor, hid->product);
> ^~~~~~~~~~~
> drivers/hid/i2c-hid/i2c-hid-core.c:994:31: error: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Werror,-Wformat]
> client->name, hid->vendor, hid->product);
> ^~~~~~~~~~~~
>
> Use an explicit cast to truncate it to the low 16 bits instead.
>
> Fixes: 9ee3e06610fd ("HID: i2c-hid: override HID descriptors for certain devices")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Applied, thanks Arnd.

--
Jiri Kosina
SUSE Labs