Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> 
> 
> 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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux