summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Bilovol <ruslan.bilovol@gmail.com>2021-06-17 19:27:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 16:21:12 +0200
commitdc138ac10ed44f906561badc353556f212f101ee (patch)
tree1631721f3d98e725f654460ddfeec8cffcc518ea
parent1e32a592942eb6bc7b0bf18143934b3a1742366e (diff)
downloadlinux-stable-dc138ac10ed44f906561badc353556f212f101ee.tar.gz
linux-stable-dc138ac10ed44f906561badc353556f212f101ee.tar.bz2
linux-stable-dc138ac10ed44f906561badc353556f212f101ee.zip
usb: gadget: f_hid: fix endianness issue with descriptors
[ 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>
-rw-r--r--drivers/usb/gadget/function/f_hid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 42e5677d932d..dd415b1589b5 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -91,7 +91,7 @@ static struct usb_interface_descriptor hidg_interface_desc = {
static struct hid_descriptor hidg_desc = {
.bLength = sizeof hidg_desc,
.bDescriptorType = HID_DT_HID,
- .bcdHID = 0x0101,
+ .bcdHID = cpu_to_le16(0x0101),
.bCountryCode = 0x00,
.bNumDescriptors = 0x1,
/*.desc[0].bDescriptorType = DYNAMIC */