]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
HID: i2c-hid: fix format string mismatch
authorArnd Bergmann <arnd@arndb.de>
Fri, 14 May 2021 13:58:50 +0000 (15:58 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:27:44 +0000 (08:27 +0200)
commit87a364fcbd15a2c392de6f90b11d5d1246bf71ad
treef44f61277794b61aa2e2c66030e29ecee169fb79
parentfb2bae494c043ee1b9a9a733e1975785ca93aa5b
HID: i2c-hid: fix format string mismatch

BugLink: https://bugs.launchpad.net/bugs/1933691
[ Upstream commit dc5f9f55502e13ba05731d5046a14620aa2ff456 ]

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@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/hid/i2c-hid/i2c-hid-core.c