re: usb: host: Faraday fotg210-hcd driver

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

 



Hello Feng-Hsin Chiang,

The patch 7d50195f6c50: "usb: host: Faraday fotg210-hcd driver" from
Jul 29, 2013, leads to the following static checker warning:

	drivers/usb/host/fotg210-hcd.c:3967 iso_stream_init()
	warn: mask and shift to zero

drivers/usb/host/fotg210-hcd.c
  3944  static void iso_stream_init(struct fotg210_hcd *fotg210,
  3945                  struct fotg210_iso_stream *stream, struct usb_device *dev,
  3946                  int pipe, unsigned interval)
  3947  {
  3948          u32 buf1;
  3949          unsigned epnum, maxp;
  3950          int is_input;
  3951          long bandwidth;
  3952          unsigned multi;
  3953  
  3954          /*
  3955           * this might be a "high bandwidth" highspeed endpoint,
  3956           * as encoded in the ep descriptor's wMaxPacket field
  3957           */
  3958          epnum = usb_pipeendpoint(pipe);
  3959          is_input = usb_pipein(pipe) ? USB_DIR_IN : 0;
  3960          maxp = usb_maxpacket(dev, pipe, !is_input);
  3961          if (is_input)
  3962                  buf1 = (1 << 11);
  3963          else
  3964                  buf1 = 0;
  3965  
  3966          maxp = max_packet(maxp);
  3967          multi = hb_mult(maxp);

"multi" is always one.  max_packet() takes the lower 11 bits and
hb_mult() shifts it to zero and adds one.  Maybe introduce another
variable or calculate hb_mult() before max_packet().

  3968          buf1 |= maxp;
  3969          maxp *= multi;
  3970  
  3971          stream->buf0 = cpu_to_hc32(fotg210, (epnum << 8) | dev->devnum);
  3972          stream->buf1 = cpu_to_hc32(fotg210, buf1);
  3973          stream->buf2 = cpu_to_hc32(fotg210, multi);

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux