Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]> class/usblp.c | 2 +- core/devio.c | 6 +++--- core/hcd.c | 2 +- core/hub.c | 6 +++--- core/message.c | 4 ++-- host/ehci-hcd.c | 2 +- host/ehci-mem.c | 8 ++++---- host/ehci-q.c | 14 +++++++------- host/ehci-sched.c | 26 +++++++++++++------------- host/sl811-hcd.c | 2 +- image/mdc800.c | 4 ++-- input/hid-core.c | 2 +- misc/usbtest.c | 4 ++-- net/usbnet.c | 9 +++++---- serial/garmin_gps.c | 8 ++++---- serial/keyspan.c | 6 +++--- 16 files changed, 53 insertions(+), 52 deletions(-)
Index: linux-warnings/drivers/usb/serial/garmin_gps.c =================================================================== --- linux-warnings/drivers/usb/serial/garmin_gps.c (revision 5) +++ linux-warnings/drivers/usb/serial/garmin_gps.c (working copy) @@ -316,7 +316,7 @@ garmin_data_p->flags |= FLAGS_QUEUING; pkt = kmalloc(sizeof(struct garmin_packet)+data_length, GFP_ATOMIC); - if (pkt == 0) { + if (pkt == NULL) { dev_err(&garmin_data_p->port->dev, "out of memory\n"); return 0; } @@ -739,7 +739,7 @@ { struct garmin_packet *pkt = NULL; - while ((pkt = pkt_pop(garmin_data_p)) != 0) { + while ((pkt = pkt_pop(garmin_data_p)) != NULL) { dbg("%s - next pkt: %d", __FUNCTION__, pkt->seq); if (gsp_send(garmin_data_p, pkt->data, pkt->size) > 0) { kfree(pkt); @@ -877,7 +877,7 @@ struct usb_serial_port *port = garmin_data_p->port; - if (port != 0 && garmin_data_p->flags & FLAGS_APP_RESP_SEEN) { + if (port != NULL && garmin_data_p->flags & FLAGS_APP_RESP_SEEN) { /* send a terminate command */ status = garmin_write_bulk(port, GARMIN_STOP_TRANSFER_REQ, sizeof(GARMIN_STOP_TRANSFER_REQ)); @@ -1366,7 +1366,7 @@ if ((garmin_data_p->flags & FLAGS_THROTTLED) == 0) { pkt = pkt_pop(garmin_data_p); - if (pkt != 0) { + if (pkt != NULL) { send_to_tty(garmin_data_p->port, pkt->data, pkt->size); kfree(pkt); Index: linux-warnings/drivers/usb/serial/keyspan.c =================================================================== --- linux-warnings/drivers/usb/serial/keyspan.c (revision 5) +++ linux-warnings/drivers/usb/serial/keyspan.c (working copy) @@ -374,7 +374,7 @@ flip = p_priv->out_flip; /* Check we have a valid urb/endpoint before we use it... */ - if ((this_urb = p_priv->out_urbs[flip]) == 0) { + if ((this_urb = p_priv->out_urbs[flip]) == NULL) { /* no bulk out, so return 0 bytes written */ dbg("%s - no output urb :(", __FUNCTION__); return count; @@ -1020,11 +1020,11 @@ flip = p_priv->out_flip; /* Check both endpoints to see if any are available. */ - if ((this_urb = p_priv->out_urbs[flip]) != 0) { + if ((this_urb = p_priv->out_urbs[flip]) != NULL) { if (this_urb->status != -EINPROGRESS) return (data_len); flip = (flip + 1) & d_details->outdat_endp_flip; - if ((this_urb = p_priv->out_urbs[flip]) != 0) + if ((this_urb = p_priv->out_urbs[flip]) != NULL) if (this_urb->status != -EINPROGRESS) return (data_len); } Index: linux-warnings/drivers/usb/image/mdc800.c =================================================================== --- linux-warnings/drivers/usb/image/mdc800.c (revision 5) +++ linux-warnings/drivers/usb/image/mdc800.c (working copy) @@ -456,7 +456,7 @@ dbg ("(mdc800_usb_probe) called."); - if (mdc800->dev != 0) + if (mdc800->dev != NULL) { warn ("only one Mustek MDC800 is supported."); return -ENODEV; @@ -1045,7 +1045,7 @@ cleanup_on_fail: - if (mdc800 != 0) + if (mdc800 != NULL) { err ("can't alloc memory!"); Index: linux-warnings/drivers/usb/net/usbnet.c =================================================================== --- linux-warnings/drivers/usb/net/usbnet.c (revision 5) +++ linux-warnings/drivers/usb/net/usbnet.c (working copy) @@ -745,7 +745,7 @@ dev->out = usb_sndbulkpipe(dev->udev, 2); // allocate irq urb - if ((data->int_urb = usb_alloc_urb (0, GFP_KERNEL)) == 0) { + if ((data->int_urb = usb_alloc_urb (0, GFP_KERNEL)) == NULL) { dbg ("%s: cannot allocate interrupt URB", dev->net->name); return -ENOMEM; @@ -2384,7 +2384,7 @@ #endif size = (sizeof (struct ethhdr) + dev->net->mtu); - if ((skb = alloc_skb (size, flags)) == 0) { + if ((skb = alloc_skb (size, flags)) == NULL) { devdbg (dev, "no rx skb"); defer_kevent (dev, EVENT_RX_MEMORY); usb_free_urb (urb); @@ -2769,7 +2769,7 @@ urb = usb_alloc_urb (0, GFP_KERNEL); else clear_bit (EVENT_RX_MEMORY, &dev->flags); - if (urb != 0) { + if (urb != NULL) { clear_bit (EVENT_RX_MEMORY, &dev->flags); rx_submit (dev, urb, GFP_KERNEL); tasklet_schedule (&dev->bh); @@ -2996,7 +2996,8 @@ // don't refill the queue all at once for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) { - if ((urb = usb_alloc_urb (0, GFP_ATOMIC)) != 0) + urb = usb_alloc_urb (0, GFP_ATOMIC); + if (urb != NULL) rx_submit (dev, urb, GFP_ATOMIC); } if (temp != dev->rxq.qlen) Index: linux-warnings/drivers/usb/core/hcd.c =================================================================== --- linux-warnings/drivers/usb/core/hcd.c (revision 5) +++ linux-warnings/drivers/usb/core/hcd.c (working copy) @@ -526,7 +526,7 @@ /* do nothing if the urb's been unlinked */ if (!urb->dev || urb->status != -EINPROGRESS - || (hcd = urb->dev->bus->hcpriv) == 0) { + || (hcd = urb->dev->bus->hcpriv) == NULL) { spin_unlock (&urb->lock); local_irq_restore (flags); return; Index: linux-warnings/drivers/usb/core/devio.c =================================================================== --- linux-warnings/drivers/usb/core/devio.c (revision 5) +++ linux-warnings/drivers/usb/core/devio.c (working copy) @@ -1127,7 +1127,7 @@ if (copy_from_user(&ctrl, arg, sizeof (ctrl))) return -EFAULT; if ((size = _IOC_SIZE (ctrl.ioctl_code)) > 0) { - if ((buf = kmalloc (size, GFP_KERNEL)) == 0) + if ((buf = kmalloc (size, GFP_KERNEL)) == NULL) return -ENOMEM; if ((_IOC_DIR(ctrl.ioctl_code) & _IOC_WRITE)) { if (copy_from_user (buf, ctrl.data, size)) { @@ -1187,7 +1187,7 @@ down_read(&usb_bus_type.subsys.rwsem); if (intf->dev.driver) driver = to_usb_driver(intf->dev.driver); - if (driver == 0 || driver->ioctl == 0) { + if (driver == NULL || driver->ioctl == NULL) { retval = -ENOTTY; } else { retval = driver->ioctl (intf, ctrl.ioctl_code, buf); @@ -1203,7 +1203,7 @@ && size > 0 && copy_to_user (ctrl.data, buf, size) != 0) retval = -EFAULT; - if (buf != 0) + if (buf != NULL) kfree (buf); return retval; } Index: linux-warnings/drivers/usb/core/hub.c =================================================================== --- linux-warnings/drivers/usb/core/hub.c (revision 5) +++ linux-warnings/drivers/usb/core/hub.c (working copy) @@ -405,7 +405,7 @@ * since each TT has "at least two" buffers that can need it (and * there can be many TTs per hub). even if they're uncommon. */ - if ((clear = kmalloc (sizeof *clear, SLAB_ATOMIC)) == 0) { + if ((clear = kmalloc (sizeof *clear, SLAB_ATOMIC)) == NULL) { dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); /* FIXME recover somehow ... RESET_TT? */ return; @@ -2300,7 +2300,7 @@ int status; qual = kmalloc (sizeof *qual, SLAB_KERNEL); - if (qual == 0) + if (qual == NULL) return; status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, @@ -2832,7 +2832,7 @@ len = le16_to_cpu(udev->config[index].desc.wTotalLength); } buf = kmalloc (len, SLAB_KERNEL); - if (buf == 0) { + if (buf == NULL) { dev_err(&udev->dev, "no mem to re-read configs after reset\n"); /* assume the worst */ return 1; Index: linux-warnings/drivers/usb/core/message.c =================================================================== --- linux-warnings/drivers/usb/core/message.c (revision 5) +++ linux-warnings/drivers/usb/core/message.c (working copy) @@ -209,7 +209,7 @@ kfree (io->urbs); io->urbs = NULL; } - if (io->dev->dev.dma_mask != 0) + if (io->dev->dev.dma_mask != NULL) usb_buffer_unmap_sg (io->dev, io->pipe, io->sg, io->nents); io->dev = NULL; } @@ -334,7 +334,7 @@ /* not all host controllers use DMA (like the mainstream pci ones); * they can use PIO (sl811) or be software over another transport. */ - dma = (dev->dev.dma_mask != 0); + dma = (dev->dev.dma_mask != NULL); if (dma) io->entries = usb_buffer_map_sg (dev, pipe, sg, nents); else Index: linux-warnings/drivers/usb/misc/usbtest.c =================================================================== --- linux-warnings/drivers/usb/misc/usbtest.c (revision 5) +++ linux-warnings/drivers/usb/misc/usbtest.c (working copy) @@ -1204,7 +1204,7 @@ struct urb *urb; urb = simple_alloc_urb (testdev_to_usbdev (dev), 0, 512); - if (urb == 0) + if (urb == NULL) return -ENOMEM; if (dev->in_pipe) { @@ -1862,7 +1862,7 @@ dev->intf = intf; /* cacheline-aligned scratch for i/o */ - if ((dev->buf = kmalloc (TBUF_SIZE, SLAB_KERNEL)) == 0) { + if ((dev->buf = kmalloc (TBUF_SIZE, SLAB_KERNEL)) == NULL) { kfree (dev); return -ENOMEM; } Index: linux-warnings/drivers/usb/input/hid-core.c =================================================================== --- linux-warnings/drivers/usb/input/hid-core.c (revision 5) +++ linux-warnings/drivers/usb/input/hid-core.c (working copy) @@ -676,7 +676,7 @@ parser->device = device; end = start + size; - while ((start = fetch_item(start, end, &item)) != 0) { + while ((start = fetch_item(start, end, &item)) != NULL) { if (item.format != HID_ITEM_FORMAT_SHORT) { dbg("unexpected long global item"); Index: linux-warnings/drivers/usb/class/usblp.c =================================================================== --- linux-warnings/drivers/usb/class/usblp.c (revision 5) +++ linux-warnings/drivers/usb/class/usblp.c (working copy) @@ -1096,7 +1096,7 @@ usblp->writebuf, 0, usblp_bulk_write, usblp); - usblp->bidir = (usblp->protocol[protocol].epread != 0); + usblp->bidir = (usblp->protocol[protocol].epread != NULL); if (usblp->bidir) usb_fill_bulk_urb(usblp->readurb, usblp->dev, usb_rcvbulkpipe(usblp->dev, Index: linux-warnings/drivers/usb/host/ehci-hcd.c =================================================================== --- linux-warnings/drivers/usb/host/ehci-hcd.c (revision 5) +++ linux-warnings/drivers/usb/host/ehci-hcd.c (working copy) @@ -796,7 +796,7 @@ * such lossage has been observed on both VT6202 and VT8235. */ if (HCD_IS_RUNNING (ehci_to_hcd(ehci)->state) && - (ehci->async->qh_next.ptr != 0 || + (ehci->async->qh_next.ptr != NULL || ehci->periodic_sched != 0)) timer_action (ehci, TIMER_IO_WATCHDOG); } Index: linux-warnings/drivers/usb/host/sl811-hcd.c =================================================================== --- linux-warnings/drivers/usb/host/sl811-hcd.c (revision 5) +++ linux-warnings/drivers/usb/host/sl811-hcd.c (working copy) @@ -1042,7 +1042,7 @@ usb_put_dev(ep->udev); kfree(ep); - hep->hcpriv = 0; + hep->hcpriv = NULL; } static int Index: linux-warnings/drivers/usb/host/ehci-q.c =================================================================== --- linux-warnings/drivers/usb/host/ehci-q.c (revision 5) +++ linux-warnings/drivers/usb/host/ehci-q.c (working copy) @@ -218,7 +218,7 @@ __releases(ehci->lock) __acquires(ehci->lock) { - if (likely (urb->hcpriv != 0)) { + if (likely (urb->hcpriv != NULL)) { struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; /* S-mask in a QH means it's an interrupt urb */ @@ -404,7 +404,7 @@ } /* last urb's completion might still need calling */ - if (likely (last != 0)) { + if (likely (last != NULL)) { ehci_urb_done (ehci, last->urb, regs); count++; ehci_qtd_free (ehci, last); @@ -846,7 +846,7 @@ /* just one way to queue requests: swap with the dummy qtd. * only hc or qh_refresh() ever modify the overlay. */ - if (likely (qtd != 0)) { + if (likely (qtd != NULL)) { struct ehci_qtd *dummy; dma_addr_t dma; __le32 token; @@ -921,12 +921,12 @@ /* Control/bulk operations through TTs don't need scheduling, * the HC and TT handle it when the TT has a buffer ready. */ - if (likely (qh != 0)) { + if (likely (qh != NULL)) { if (likely (qh->qh_state == QH_STATE_IDLE)) qh_link_async (ehci, qh_get (qh)); } spin_unlock_irqrestore (&ehci->lock, flags); - if (unlikely (qh == 0)) { + if (unlikely (qh == NULL)) { qtd_list_free (ehci, urb, qtd_list); return -ENOMEM; } @@ -967,7 +967,7 @@ * active but idle for a while once it empties. */ if (HCD_IS_RUNNING (ehci_to_hcd(ehci)->state) - && ehci->async->qh_next.qh == 0) + && ehci->async->qh_next.qh == NULL) timer_action (ehci, TIMER_ASYNC_OFF); } @@ -1048,7 +1048,7 @@ timer_action_done (ehci, TIMER_ASYNC_SHRINK); rescan: qh = ehci->async->qh_next.qh; - if (likely (qh != 0)) { + if (likely (qh != NULL)) { do { /* clean any finished work for this qh */ if (!list_empty (&qh->qtd_list) Index: linux-warnings/drivers/usb/host/ehci-mem.c =================================================================== --- linux-warnings/drivers/usb/host/ehci-mem.c (revision 5) +++ linux-warnings/drivers/usb/host/ehci-mem.c (working copy) @@ -51,7 +51,7 @@ dma_addr_t dma; qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); - if (qtd != 0) { + if (qtd != NULL) { ehci_qtd_init (qtd, dma); } return qtd; @@ -98,7 +98,7 @@ /* dummy td enables safe urb queuing */ qh->dummy = ehci_qtd_alloc (ehci, flags); - if (qh->dummy == 0) { + if (qh->dummy == NULL) { ehci_dbg (ehci, "no dummy td\n"); dma_pool_free (ehci->qh_pool, qh, qh->qh_dma); qh = NULL; @@ -215,7 +215,7 @@ dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller, ehci->periodic_size * sizeof(__le32), &ehci->periodic_dma, 0); - if (ehci->periodic == 0) { + if (ehci->periodic == NULL) { goto fail; } for (i = 0; i < ehci->periodic_size; i++) @@ -223,7 +223,7 @@ /* software shadow of hardware table */ ehci->pshadow = kmalloc (ehci->periodic_size * sizeof (void *), flags); - if (ehci->pshadow == 0) { + if (ehci->pshadow == NULL) { goto fail; } memset (ehci->pshadow, 0, ehci->periodic_size * sizeof (void *)); Index: linux-warnings/drivers/usb/host/ehci-sched.c =================================================================== --- linux-warnings/drivers/usb/host/ehci-sched.c (revision 5) +++ linux-warnings/drivers/usb/host/ehci-sched.c (working copy) @@ -604,7 +604,7 @@ /* get qh and force any scheduling errors */ INIT_LIST_HEAD (&empty); qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv); - if (qh == 0) { + if (qh == NULL) { status = -ENOMEM; goto done; } @@ -615,7 +615,7 @@ /* then queue the urb's tds to the qh */ qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv); - BUG_ON (qh == 0); + BUG_ON (qh == NULL); /* ... update usbfs periodic stats */ ehci_to_hcd(ehci)->self.bandwidth_int_reqs++; @@ -638,7 +638,7 @@ struct ehci_iso_stream *stream; stream = kmalloc(sizeof *stream, mem_flags); - if (likely (stream != 0)) { + if (likely (stream != NULL)) { memset (stream, 0, sizeof(*stream)); INIT_LIST_HEAD(&stream->td_list); INIT_LIST_HEAD(&stream->free_list); @@ -791,7 +791,7 @@ static inline struct ehci_iso_stream * iso_stream_get (struct ehci_iso_stream *stream) { - if (likely (stream != 0)) + if (likely (stream != NULL)) stream->refcount++; return stream; } @@ -813,9 +813,9 @@ spin_lock_irqsave (&ehci->lock, flags); stream = ep->hcpriv; - if (unlikely (stream == 0)) { + if (unlikely (stream == NULL)) { stream = iso_stream_alloc(GFP_ATOMIC); - if (likely (stream != 0)) { + if (likely (stream != NULL)) { /* dev->ep owns the initial refcount */ ep->hcpriv = stream; stream->ep = ep; @@ -850,7 +850,7 @@ size += packets * sizeof (struct ehci_iso_packet); iso_sched = kmalloc (size, mem_flags); - if (likely (iso_sched != 0)) { + if (likely (iso_sched != NULL)) { memset(iso_sched, 0, size); INIT_LIST_HEAD (&iso_sched->td_list); } @@ -927,7 +927,7 @@ unsigned long flags; sched = iso_sched_alloc (urb->number_of_packets, mem_flags); - if (unlikely (sched == 0)) + if (unlikely (sched == NULL)) return -ENOMEM; itd_sched_init (sched, stream, urb); @@ -961,7 +961,7 @@ spin_lock_irqsave (&ehci->lock, flags); } - if (unlikely (0 == itd)) { + if (unlikely (NULL == itd)) { iso_sched_free (stream, sched); spin_unlock_irqrestore (&ehci->lock, flags); return -ENOMEM; @@ -1416,7 +1416,7 @@ /* Get iso_stream head */ stream = iso_stream_find (ehci, urb); - if (unlikely (stream == 0)) { + if (unlikely (stream == NULL)) { ehci_dbg (ehci, "can't get iso stream\n"); return -ENOMEM; } @@ -1530,7 +1530,7 @@ unsigned long flags; iso_sched = iso_sched_alloc (urb->number_of_packets, mem_flags); - if (iso_sched == 0) + if (iso_sched == NULL) return -ENOMEM; sitd_sched_init (iso_sched, stream, urb); @@ -1784,7 +1784,7 @@ /* Get iso_stream head */ stream = iso_stream_find (ehci, urb); - if (stream == 0) { + if (stream == NULL) { ehci_dbg (ehci, "can't get iso stream\n"); return -ENOMEM; } @@ -1889,7 +1889,7 @@ type = Q_NEXT_TYPE (*hw_p); modified = 0; - while (q.ptr != 0) { + while (q.ptr != NULL) { unsigned uf; union ehci_shadow temp; int live; ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel