]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
usb: gadget: f_hid: fix endianness issue with descriptors
authorRuslan Bilovol <ruslan.bilovol@gmail.com>
Thu, 17 Jun 2021 16:27:55 +0000 (19:27 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:48:53 +0000 (18:48 +0200)
commitcb563cc592c40870e94095823fd9308cae8738af
tree2046a7acdb876ecc3a75c0247af008b27d535ff2
parent6a1dac0ef13735f3b6a7cdcae3f27c2fb87a6e0f
usb: gadget: f_hid: fix endianness issue with descriptors

BugLink: https://bugs.launchpad.net/bugs/1939440
[ Upstream commit 33cb46c4676d01956811b68a29157ea969a5df70 ]

Running sparse checker it shows warning message about
incorrect endianness used for descriptor initialization:

| f_hid.c:91:43: warning: incorrect type in initializer (different base types)
| f_hid.c:91:43:    expected restricted __le16 [usertype] bcdHID
| f_hid.c:91:43:    got int

Fixing issue with cpu_to_le16() macro, however this is not a real issue
as the value is the same both endians.

Cc: Fabien Chouteau <fabien.chouteau@barco.com>
Cc: Segiy Stetsyuk <serg_stetsuk@ukr.net>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/20210617162755.29676-1-ruslan.bilovol@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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/usb/gadget/function/f_hid.c