Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146482pxv; Fri, 9 Jul 2021 19:29:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0JA/i1kPB0c5/O9EN+DKed0b+qwfsx98SbnQWUP/bM4ogqQROaTI8zkTspNVpt8CwGnBv X-Received: by 2002:aa7:cfcf:: with SMTP id r15mr3282240edy.161.1625884177015; Fri, 09 Jul 2021 19:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884177; cv=none; d=google.com; s=arc-20160816; b=GXwVSEdDd+pWYBBpb7G7M9q6etpOr0twX2uR0HZAu96WDSGUTpMngu1taNyqy9s9r2 ZHiAS0YfgLcenRvi8XBBK3bCSVdMap9Pd8C4U0dP8aKx3JLCqpJ60OTzEK2v5drL6JLs raiVfRt00+QTJrqUoa0PZy6SdqFJKf1GSH0CXI2AujR7fYsKRRSwAwL4EKlIaMQdJWx1 HwIyJVvfbNvFXKvdYfsLBfkqFZTcDOEPRsSsdhuFrI9Zq+GMRfCtQGx1xE9ZJ+dXzdoO P3gao4KcBrUaKt3suAtwcxQ9Yss+yvdt5lrHJQ8ZqyH2U5fqcyrM9KCCvEAomtQb7s3k 13AQ== 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=tO70Ieq446CHHDYM9QaN/We57e1uX5xHetOG4r5lRP3pdsKvCO9Nn0TNHDrTphQYBF lyU3t82rcjRxeMs9B9DVKmQ1ty+WDn2l+AVvmNl3kiP4wJNK1CYscFkbmQIU3Y8dvptS 3+1IxgwpVusytmYVk+KUlzeAl6/lfOZy3JVzDRcGYhCZx3uBlz62R7uL1gHKLoj8X/KH PzcgiRzaDGjt1rDQOsDbVCiOa8RLKn6TZbjX6Kfglz+vbHUVhgJavNiPyDixLQ3kdMMf F33V7olGIMAQTrYuo1TRHf8W36eZoqXZzAV062A1sXxCjS4FrRnSblW5+PFKjHY7XZrd QNGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bwhjOEae; 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 dj21si8651706edb.391.2021.07.09.19.29.14; Fri, 09 Jul 2021 19:29:37 -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=bwhjOEae; 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 S233769AbhGJC2p (ORCPT + 99 others); Fri, 9 Jul 2021 22:28:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233104AbhGJC0z (ORCPT ); Fri, 9 Jul 2021 22:26:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46887613ED; Sat, 10 Jul 2021 02:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883843; bh=dHZi18C9lJeUvnD0sWQG3L29nXUo5nkGqGTKq+/lsCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwhjOEaeUuYDT6i8wQK+gfBESQo3c8eKC2loSVV+tehFh/XCwDGR1agelJzIeBLbP zKFDKcGpLdn98xDNS5uaWadg5fMxQp9EBDfkmuz2mVTmqyYM4W3uH7SKnR1gzBPbYd DxIUoLGnSHeY+CTavSCKTfG1/vHqDWA+hPntTHQaSBQzbfPVNFrRYyrda/pr8Ydq9P oONJAkY/Oa5pzSzFEJIvdvZoOiGUT+Tt5JjQpZqik4OBh0JDkJAgvBAHZrdgqYG8v1 GvtS6614QzLv8KuLMTvMlWohss98VKUxe8NnXz2yFAc+OtnXcjDIXxRLmY9lNdH3pC xj0IMUdC8Pv0A== 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.12 088/104] usb: gadget: f_hid: fix endianness issue with descriptors Date: Fri, 9 Jul 2021 22:21:40 -0400 Message-Id: <20210710022156.3168825-88-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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