Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1150527pxv; Fri, 9 Jul 2021 19:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztwQiKFpuOWscMTO1J/YI+ynvhAIUHAaB5dEBsxVJXKUaxNYjwJnFgpRFByc1l6cPSCl7a X-Received: by 2002:a05:6e02:2192:: with SMTP id j18mr28682738ila.33.1625884679460; Fri, 09 Jul 2021 19:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884679; cv=none; d=google.com; s=arc-20160816; b=MToBnaVIY0s4vhdgyXM5q5Ml9sAA0Wh3A+lNrWQ98u7rGDSQmhpVVpqApRwX/+yVxd keP/kKRE9pzzBeAeZ5lJyX8j8dyxgxHJGx9sYbB0a1ZVxQQdpj58UMxG0iF4m8AKYNCJ o1r9RdTZH7hKZx/qzGEfTPmfq3EjDxi4JT9RfOKlZQMmCl8bzj1RIcBuVMfmXuVAbDlT B2WUzlsLRtSzxZwuq/GHsHRWh4dR2TD8Xp6fKPNG5QUpmrSo5qyKxd0x+cbuoQodKDmZ tNYdUpxnYARYpfSqHoSEDev3aKWXnkC9rLyfcl48YNFOEPuTPbTseivd60T3YX0okwfX L1Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NSo7PzxHdp4PJsoGIYbDaqVwqGCw2IV3iEDF0nfsN5Y=; b=z3RGBjsRxInQ+qN9zOIFs4vvHSl8P+z5lzzHEuj1tAWL3dRumfkalRQOo1oun2jjwP tawyyP7oNl9UpcQdO3jCOObRNy4TUBf0T/LDZGkL46bzTQvNa1k8wifGwZuNAOst7JuJ lA5MKVhQxRecunL0zST80My1K3SVeQz1WJUmu8dTHKbdUN3A0NCJfc527J4WiG0UOxMh Jx7I8xSz0wKA+g45Ogh9uYtdwFwSmptoVquRWKWBTbQSLK2GKvmjJuV2wszlwPCMt1u0 M4af0LY6Kgxy0fc6XaYiA0/RnLJ2hOxMk/Vohn/IAwUpjxyrSQcrJdNGKZitvv0c5Ybb KFAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L4ZfeLFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si8027870iom.9.2021.07.09.19.37.46; Fri, 09 Jul 2021 19:37:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L4ZfeLFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234231AbhGJCj6 (ORCPT + 99 others); Fri, 9 Jul 2021 22:39:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:58366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbhGJCjR (ORCPT ); Fri, 9 Jul 2021 22:39:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F084613DF; Sat, 10 Jul 2021 02:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884502; bh=yMXnnkfIQlp/RvYtTMPWmx93X7T3LtLLKbKSmLuyZtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4ZfeLFWr0c4r4/ZGRBHWn7ZKt/tGuIjhPXa1dhl+TxiC37EiFkYyEJOO6Z7hIr0i ZqdM6pOtBPrcBeV+/XLp5K/6lEoJA3hItNWf9XlhgZwHfRSe3j89hyKKA87ddlF6BO 94Qc1zGrtvE8LKrs55Fdcn+y9r6ZkoGNdteePAQjegUtDdfgticDval2OLJNTnE65z UQAM2WZqdeWEaGDlm4mHbI3wAKERXXHxw7cDOke++pVWupbmCk4mnH/538yIuy54s4 XsgYh2A/3V4iiT7/5sTIY5Ekc6mJQXbw4GKexQI7x2HeMYvALSesF6A3JBDYxlFLWT hxVtoF3HSvq/A== 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 4.19 30/39] usb: gadget: f_hid: fix endianness issue with descriptors Date: Fri, 9 Jul 2021 22:31:55 -0400 Message-Id: <20210710023204.3171428-30-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-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: linux-kernel@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 bc0a693c3260..fa8a8e04008a 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