Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1148505pxv; Fri, 9 Jul 2021 19:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXWo2bya/r1Nu33Z/R8r/08U/xZeW39hcskJdQ5S22HpDhk7NoIHK3bvJXVZACuUrltmIQ X-Received: by 2002:a17:906:5fc1:: with SMTP id k1mr19920607ejv.360.1625884423933; Fri, 09 Jul 2021 19:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884423; cv=none; d=google.com; s=arc-20160816; b=uD13ZXxnZBaXCv7Vj7JNuXbGSCz4/Z70c4WXWIElPkTf3Z3RpQb0Cruj/SWMZJukE/ PQTO9KS+EAZ8q9IFXHIacs/u3MKHS6LjN6h+5MkOhCiVCD1Yqv98QpWqWgjyNUJ9J2WS wT7xiZVpdUa9+yNP9hooHWzpeYOQRq4KIFfh7uCHczhvihy6DKoXL6GBfKOtFG+qkyDB bk9YU4pC4Gdakqan1X6JxXXWJt3YMs1Ngp/SEbT4IV2UKckTa9/gFKxUYsaO7Gav8n1g etOsThTCrAs4uT7FNAKz8fVEaXeqyeJt1q40Ihvwq0aX9NN1i/SskLTRE40x03dzKg// BvDw== 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=az4YI6pEc1seBZOKvPPF86Ukqv5IgEa0IF+CMNXURuk=; b=zMHCluW3w+Pd/qv0/gfRQvNs5G9IVYNlVc5tcbGe4o7N/PATnd1yUM0Bskno0pWU1t CTfZxtKkbx0U6XsV9YSGrvPNh8LCjc3MX+ghsLjnqV8UfIZA4IYs+HFm+ZsKdnrKikRN A+P0qk31KjpCwcrplxjpi47EejCU86IO01YkGDlQXS6qWgSf12TD4wbpzIWQ+MyCfy4w ZvjGjAAPTdJEYwuS7TUBW573z4d7577th9ufOv2fQP8GUOhX0NUwPAjvcROLAMJs0rXu EWhtP4wWmywhVIhGB+eK3sjz/0O80MiBgTiLHiJOi0xkQPH4Kxyc5ITyx2XMWR3+Qb/9 ZpCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AiPKl5kj; 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 gt34si9126280ejc.285.2021.07.09.19.33.21; Fri, 09 Jul 2021 19:33:43 -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=AiPKl5kj; 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 S234746AbhGJCeK (ORCPT + 99 others); Fri, 9 Jul 2021 22:34:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:42146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234558AbhGJC3g (ORCPT ); Fri, 9 Jul 2021 22:29:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 70807613DF; Sat, 10 Jul 2021 02:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884004; bh=dHZi18C9lJeUvnD0sWQG3L29nXUo5nkGqGTKq+/lsCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AiPKl5kjWX7t04I0i5U2gm5N7vFUcfkdi566L+JmzkQjhykljeimezWfYrkGXrwKs r1egQxVaoV4Ee+LTrrYYJyMTu5bha4uK3Of/jmBXuCbYes20o0mcqO9/6Y7VdQ+qC/ +7nHwTLhsMD+Cg5tNsvMp0nAZifEO2+RkWX07BTyKqBmjjnLB6nQc9zy14GGkjOUj7 po8IftanrSxuyqD827EoTbqfKxqIqlMHq1JlzHuFFSPQEoE9zPVFepaZLdZhkNgGu1 +LA2O3UpVvx/wV3b8S5EqzgnJwlbbO/qdyaWfzPrkPds56T4GNDxxjmF4feeZ3JFch UDBRtknub74yw== 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.10 78/93] usb: gadget: f_hid: fix endianness issue with descriptors Date: Fri, 9 Jul 2021 22:24:12 -0400 Message-Id: <20210710022428.3169839-78-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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 e55699308117..a82b3de1a54b 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