linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [balbi-usb:master 33/36] drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)
@ 2012-09-10 16:40 Fengguang Wu
  2012-09-10 17:05 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Fengguang Wu @ 2012-09-10 16:40 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git master
head:   d9c88901337158c9f253a7de58a10b5125d61d26
commit: 7a7322b0a5d984025dd4faea9098b8fef07f8d8f [33/36] usb: gadget: remove usb_gadget_controller_number()

All sparse warnings:

  drivers/usb/gadget/f_acm.c:287:9: sparse: advancing past deep designator
  drivers/usb/gadget/f_obex.c:60:9: sparse: advancing past deep designator
  drivers/usb/gadget/f_serial.c:134:9: sparse: advancing past deep designator
  drivers/usb/gadget/serial.c:66:9: sparse: advancing past deep designator
+ drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)

vim +89 drivers/usb/gadget/serial.c
    79	static struct usb_device_descriptor device_desc = {
    80		.bLength =		USB_DT_DEVICE_SIZE,
    81		.bDescriptorType =	USB_DT_DEVICE,
    82		.bcdUSB =		cpu_to_le16(0x0200),
    83		/* .bDeviceClass = f(use_acm) */
    84		.bDeviceSubClass =	0,
    85		.bDeviceProtocol =	0,
    86		/* .bMaxPacketSize0 = f(hardware) */
    87		.idVendor =		cpu_to_le16(GS_VENDOR_ID),
    88		/* .idProduct =	f(use_acm) */
  > 89		.bcdDevice = cpu_to_le16(GS_VERSION_NUM << 16),
    90		/* .iManufacturer = DYNAMIC */
    91		/* .iProduct = DYNAMIC */
    92		.bNumConfigurations =	1,
    93	};
    94	
    95	static struct usb_otg_descriptor otg_descriptor = {
    96		.bLength =		sizeof otg_descriptor,
    97		.bDescriptorType =	USB_DT_OTG,
    98	
    99		/* REVISIT SRP-only hardware is possible, although

---
0-DAY kernel build testing backend         Open Source Technology Centre
Fengguang Wu <wfg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>                     Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [balbi-usb:master 33/36] drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)
  2012-09-10 16:40 [balbi-usb:master 33/36] drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0) Fengguang Wu
@ 2012-09-10 17:05 ` Sebastian Andrzej Siewior
       [not found]   ` <504E1DCB.3000003-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-09-10 17:05 UTC (permalink / raw)
  To: Fengguang Wu
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On 09/10/2012 06:40 PM, Fengguang Wu wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git master
> head:   d9c88901337158c9f253a7de58a10b5125d61d26
> commit: 7a7322b0a5d984025dd4faea9098b8fef07f8d8f [33/36] usb: gadget: remove usb_gadget_controller_number()
>
> All sparse warnings:

Once again, thank you.

>    drivers/usb/gadget/f_acm.c:287:9: sparse: advancing past deep designator
>    drivers/usb/gadget/f_obex.c:60:9: sparse: advancing past deep designator
>    drivers/usb/gadget/f_serial.c:134:9: sparse: advancing past deep designator
>    drivers/usb/gadget/serial.c:66:9: sparse: advancing past deep designator

I don't get these. The purpose is an all NULL terminating entry. Could
this be a sparse bug or is the [] / {} switch not really good C code?

> + drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)

I've sent a patch for this.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [balbi-usb:master 33/36] drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)
       [not found]   ` <504E1DCB.3000003-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
@ 2012-09-11 10:55     ` Fengguang Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Fengguang Wu @ 2012-09-11 10:55 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Dan Carpenter

On Mon, Sep 10, 2012 at 07:05:15PM +0200, Sebastian Andrzej Siewior wrote:
> On 09/10/2012 06:40 PM, Fengguang Wu wrote:
> >tree:   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git master
> >head:   d9c88901337158c9f253a7de58a10b5125d61d26
> >commit: 7a7322b0a5d984025dd4faea9098b8fef07f8d8f [33/36] usb: gadget: remove usb_gadget_controller_number()
> >
> >All sparse warnings:
> 
> Once again, thank you.

You are welcome!

> >   drivers/usb/gadget/f_acm.c:287:9: sparse: advancing past deep designator
> >   drivers/usb/gadget/f_obex.c:60:9: sparse: advancing past deep designator
> >   drivers/usb/gadget/f_serial.c:134:9: sparse: advancing past deep designator
> >   drivers/usb/gadget/serial.c:66:9: sparse: advancing past deep designator
> 
> I don't get these. The purpose is an all NULL terminating entry. Could
> this be a sparse bug or is the [] / {} switch not really good C code?

http://marc.info/?l=linux-sparse&m=130673652023059&w=4

According to Dan's explanations, I'll filter out these warnings in future.

> >+ drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0)
> 
> I've sent a patch for this.

Thank you!

Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-09-11 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 16:40 [balbi-usb:master 33/36] drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from constant value (24000000 becomes 0) Fengguang Wu
2012-09-10 17:05 ` Sebastian Andrzej Siewior
     [not found]   ` <504E1DCB.3000003-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2012-09-11 10:55     ` Fengguang Wu

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).