From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6280C11F72 for ; Sat, 10 Jul 2021 02:33:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC2FC613C5 for ; Sat, 10 Jul 2021 02:33:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234502AbhGJCfn (ORCPT ); Fri, 9 Jul 2021 22:35:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:53348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235288AbhGJCem (ORCPT ); Fri, 9 Jul 2021 22:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6EC10613EB; Sat, 10 Jul 2021 02:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884308; bh=TGUlphfg0gPw5fgVemP1gCgF3rAL9XkfQysAcYM8f3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEGSf7pw+fI05mJl1H1Od2vY/wahUi8CyaWRnzmny5Npsm2vTvzjHqeH8ZEEWPPos HBIWuOlVY1+m9g0ZN4qZ9y/SCU94MJlVlg6eYE+hfrEDp+Hx6Ysc7fnSBMeIb4ToCo 8EPO475SKFb4g9j/HKyed7gXmLnenixgMygra9Kcxrn6d2yyG/Dr6I/pWGRsgVNDch lCfNCllEQ90tKUAE3LCT63pJRdtjrI+NbNDqA//wviEDas63F8g2WqG38ck0KDfX3T mtfUTqiGvsbKBRMTpWsnPFxG0kKHuL/ZffJbpnpKGA6l8w2BaM5hsMWVFTfxGLmYPU JpETkl60Of8NQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ruslan Bilovol , Fabien Chouteau , Segiy Stetsyuk , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 52/63] usb: gadget: f_hid: fix endianness issue with descriptors Date: Fri, 9 Jul 2021 22:26:58 -0400 Message-Id: <20210710022709.3170675-52-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022709.3170675-1-sashal@kernel.org> References: <20210710022709.3170675-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ruslan Bilovol [ 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 Cc: Segiy Stetsyuk Signed-off-by: Ruslan Bilovol Link: https://lore.kernel.org/r/20210617162755.29676-1-ruslan.bilovol@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/function/f_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 0586229ac83d..3d540b0d9368 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -88,7 +88,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 */ -- 2.30.2