linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
Date: Thu, 13 Feb 2020 09:56:23 +0100	[thread overview]
Message-ID: <034bc43c35a75a84787bc786c8694607552a8139.camel@hadess.net> (raw)
In-Reply-To: <202002131558.UH2wlHsI%lkp@intel.com>

On Thu, 2020-02-13 at 15:01 +0800, kbuild test robot wrote:
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-
> testing
> head:   249fa8217b846a7c031b997bd4ea70d65d3ff774
> commit: 249fa8217b846a7c031b997bd4ea70d65d3ff774 [18/18] USB: Add
> driver to control USB fast charge for iOS devices
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-166-g7e4a5b6f-dirty
>         git checkout 249fa8217b846a7c031b997bd4ea70d65d3ff774
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
> > > drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse:
> > > restricted __le16 degrades to integer
>    drivers/usb/misc/apple-mfi-fastcharge.c:174:29: sparse: sparse:
> restricted __le16 degrades to integer
> 
> vim +173 drivers/usb/misc/apple-mfi-fastcharge.c
> 
>    165	
>    166	static int mfi_fc_probe(struct usb_device *udev)
>    167	{
>    168		struct power_supply_config battery_cfg = {};
>    169		struct mfi_device *mfi = NULL;
>    170		int err;
>    171	
>    172		/* See comment above mfi_fc_id_table[] */
>  > 173		if (udev->descriptor.idProduct < 0x1200 ||
>    174		    udev->descriptor.idProduct > 0x12ff) {

Is that something I should be fixing? I'm guessing that I just need to
cast the constant side to a type the same size as those fields, but is
that necessary?

Cheers


  reply	other threads:[~2020-02-13  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  7:01 [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer kbuild test robot
2020-02-13  8:56 ` Bastien Nocera [this message]
2020-02-13 10:37   ` Oliver Neukum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=034bc43c35a75a84787bc786c8694607552a8139.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).