public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/usb/usbip/vudc_rx.c:145: possible bad bitmask ?
@ 2016-07-18 12:29 David Binderman
  2016-08-09 14:09 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: David Binderman @ 2016-07-18 12:29 UTC (permalink / raw)
  To: valentina.manea.m, shuahkh, gregkh, linux-usb,
	Linux Kernel Mailing List, dcb314

Hello there,

drivers/usb/usbip/vudc_rx.c:145:27: warning: result of ‘11 << 30’
requires 35 bits to represent, but ‘int’ only has 32 bits
[-Wshift-overflow=]

Source code is

    urb_p->urb->pipe &= ~(11 << 30);

Maybe better code

    urb_p->urb->pipe &= ~(11UL << 30);

Regards

David Binderman

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

* Re: drivers/usb/usbip/vudc_rx.c:145: possible bad bitmask ?
  2016-07-18 12:29 drivers/usb/usbip/vudc_rx.c:145: possible bad bitmask ? David Binderman
@ 2016-08-09 14:09 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-08-09 14:09 UTC (permalink / raw)
  To: David Binderman
  Cc: valentina.manea.m, shuahkh, linux-usb, Linux Kernel Mailing List,
	dcb314

On Mon, Jul 18, 2016 at 01:29:05PM +0100, David Binderman wrote:
> Hello there,
> 
> drivers/usb/usbip/vudc_rx.c:145:27: warning: result of ‘11 << 30’
> requires 35 bits to represent, but ‘int’ only has 32 bits
> [-Wshift-overflow=]
> 
> Source code is
> 
>     urb_p->urb->pipe &= ~(11 << 30);
> 
> Maybe better code
> 
>     urb_p->urb->pipe &= ~(11UL << 30);

Perhaps, care to send a patch?

thanks,

greg k-h

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

end of thread, other threads:[~2016-08-09 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-18 12:29 drivers/usb/usbip/vudc_rx.c:145: possible bad bitmask ? David Binderman
2016-08-09 14:09 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox