All of lore.kernel.org
 help / color / mirror / Atom feed
* [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
@ 2020-02-13  7:01 ` kbuild test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2020-02-13  7:01 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: kbuild-all, linux-usb, Greg Kroah-Hartman

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) {
   175			return -ENODEV;
   176		}
   177	
   178		mfi = kzalloc(sizeof(struct mfi_device), GFP_KERNEL);
   179		if (!mfi) {
   180			err = -ENOMEM;
   181			goto error;
   182		}
   183	
   184		battery_cfg.drv_data = mfi;
   185	
   186		mfi->charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
   187		mfi->battery = power_supply_register(&udev->dev,
   188							&apple_mfi_fc_desc,
   189							&battery_cfg);
   190		if (IS_ERR(mfi->battery)) {
   191			dev_err(&udev->dev, "Can't register battery\n");
   192			err = PTR_ERR(mfi->battery);
   193			goto error;
   194		}
   195	
   196		mfi->udev = usb_get_dev(udev);
   197		dev_set_drvdata(&udev->dev, mfi);
   198	
   199		return 0;
   200	
   201	error:
   202		kfree(mfi);
   203		return err;
   204	}
   205	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
@ 2020-02-13  7:01 ` kbuild test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2020-02-13  7:01 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]

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) {
   175			return -ENODEV;
   176		}
   177	
   178		mfi = kzalloc(sizeof(struct mfi_device), GFP_KERNEL);
   179		if (!mfi) {
   180			err = -ENOMEM;
   181			goto error;
   182		}
   183	
   184		battery_cfg.drv_data = mfi;
   185	
   186		mfi->charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
   187		mfi->battery = power_supply_register(&udev->dev,
   188							&apple_mfi_fc_desc,
   189							&battery_cfg);
   190		if (IS_ERR(mfi->battery)) {
   191			dev_err(&udev->dev, "Can't register battery\n");
   192			err = PTR_ERR(mfi->battery);
   193			goto error;
   194		}
   195	
   196		mfi->udev = usb_get_dev(udev);
   197		dev_set_drvdata(&udev->dev, mfi);
   198	
   199		return 0;
   200	
   201	error:
   202		kfree(mfi);
   203		return err;
   204	}
   205	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
  2020-02-13  7:01 ` kbuild test robot
@ 2020-02-13  8:56   ` Bastien Nocera
  -1 siblings, 0 replies; 6+ messages in thread
From: Bastien Nocera @ 2020-02-13  8:56 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-usb, Greg Kroah-Hartman

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
@ 2020-02-13  8:56   ` Bastien Nocera
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien Nocera @ 2020-02-13  8:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
  2020-02-13  8:56   ` Bastien Nocera
@ 2020-02-13 10:37     ` Oliver Neukum
  -1 siblings, 0 replies; 6+ messages in thread
From: Oliver Neukum @ 2020-02-13 10:37 UTC (permalink / raw)
  To: Bastien Nocera, kbuild test robot
  Cc: kbuild-all, linux-usb, Greg Kroah-Hartman

Am Donnerstag, den 13.02.2020, 09:56 +0100 schrieb Bastien Nocera:
> 
> 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?

Hi,

I am on it. Expect a patch in half an hour.

	Regards
		Oliver


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [usb:usb-testing 18/18] drivers/usb/misc/apple-mfi-fastcharge.c:173:29: sparse: sparse: restricted __le16 degrades to integer
@ 2020-02-13 10:37     ` Oliver Neukum
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Neukum @ 2020-02-13 10:37 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

Am Donnerstag, den 13.02.2020, 09:56 +0100 schrieb Bastien Nocera:
> 
> 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?

Hi,

I am on it. Expect a patch in half an hour.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-13 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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  7:01 ` kbuild test robot
2020-02-13  8:56 ` Bastien Nocera
2020-02-13  8:56   ` Bastien Nocera
2020-02-13 10:37   ` Oliver Neukum
2020-02-13 10:37     ` Oliver Neukum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.