Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp727763pxj; Thu, 17 Jun 2021 12:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxpYAEiDde86SJSw3nMurEIgGs9WN2RyX+ZkFXs+Vog77XHK6LE9StiZ4P3QGArKxC+ne4 X-Received: by 2002:a17:906:b24a:: with SMTP id ce10mr6985502ejb.83.1623957776055; Thu, 17 Jun 2021 12:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623957776; cv=none; d=google.com; s=arc-20160816; b=kg3KxCVfz+87dqJX0TftHAVyEzopOujOLMjSP1iH2GoJONzVHEV1O81CTjDk7RlKjy pjdZw1IbCiqiP1/+llJVrblK7Okdh9kTYd7e8estRX4BZBrK4YJFI8pcEIimgVzxTAb3 AILyO6QHQOfiDnlMwXCkIU2tsPLpY1h9PwboFdI/nZitD0Xz+K8AujVQL7rAw/EOQOvy yxGlbHcGgX46oXm3qbgRQtyG9RkjRP5kuzFy6m5X4nLQqIfatXDvkRH76pmtkKRFDGCt vxKraroepGqLrD9LuEzK9ltY7TbKH7ThF28c5SBsRDUAOZlz4CZqKAQolN6rKWtzptHB qKCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4thZvRpiv1rS0prJX6D6zbSU/ogd03EQgvAM2cusF1g=; b=WcKCLH8RliI5ZoixXWsJam7JPIXTjqx/6fR72R51Z/v8jAxYjNfXvnbzj+oTfnCQNl QyDu+1CMueg522BPlN3CWWq2nhzin6IRxo6hWjBmzNtdvGgTkJcdol4gZ1MEJgOGb4VX h1ao73vVVNFGm23hstRLZuaRBUaeOVGY+IwJ7lC23aERZIFDbhbVLRsSa45m34iou+8b ExhpgMEBXsxubIFLXFXpsGcDt+93Z56Js4N38v89aKiWRKZjKYP+X2LaMhCUxT5l19VK +UzA8c88LpLvgo22iJ8lvWjYzOC4stEkyYc29g4Bp6NZgTSU2BQfuEtFR83LuD+48o1P d6Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C7ZND+T2; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si5908875edw.414.2021.06.17.12.22.33; Thu, 17 Jun 2021 12:22:56 -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=@linuxfoundation.org header.s=korg header.b=C7ZND+T2; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231284AbhFQQzF (ORCPT + 99 others); Thu, 17 Jun 2021 12:55:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:59778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbhFQQzF (ORCPT ); Thu, 17 Jun 2021 12:55:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D846B610A2; Thu, 17 Jun 2021 16:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623948777; bh=OOsFdi80wy5W6ivV1HCR4PBnh1VaW31ogvRDn0R+dro=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C7ZND+T23mGAewGjh3QqBECJFT2uGHd79xpUFdN4wNLwc0St16pfOk3QyKveudEJ3 ZQkpwwjEKNItQDJBxnA4SbkV0BAHShxhpkrh01tsKrbukLYci16TASr8SpYM65/BzL qwbkhwLS7ua5CyGPeKsHh70gpHOP0YfLhCY5jSu4= Date: Thu, 17 Jun 2021 18:52:54 +0200 From: Greg Kroah-Hartman To: Ruslan Bilovol Cc: Felipe Balbi , Fabien Chouteau , Segiy Stetsyuk , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH] usb: gadget: f_hid: fix endianness issue with descriptors Message-ID: References: <20210617162755.29676-1-ruslan.bilovol@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210617162755.29676-1-ruslan.bilovol@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 07:27:55PM +0300, Ruslan Bilovol wrote: > 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 > > Fixes: 71adf1189469 ("USB: gadget: add HID gadget driver") > Cc: Fabien Chouteau > Cc: Segiy Stetsyuk > Cc: stable@kernel.org > Signed-off-by: Ruslan Bilovol > --- > 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 70774d8cb14e..02683ac0719d 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), This is a BCD value, not a little-endian value, are you sure this conversion is correct? thanks, greg k-h