ChangeSet 1.1757.66.8, 2004/07/14 14:44:29-07:00, greg@kroah.com [PATCH] USB: more sparse cleanups (all pretty much NULL usages.) Signed-off-by: Greg Kroah-Hartman drivers/usb/class/usb-midi.c | 16 ++++++++-------- drivers/usb/host/ehci-dbg.c | 2 +- drivers/usb/host/ehci-sched.c | 12 ++++++------ drivers/usb/host/ohci-dbg.c | 6 +++--- drivers/usb/host/ohci-hcd.c | 10 +++++----- drivers/usb/host/ohci-hub.c | 6 +++--- drivers/usb/host/ohci-mem.c | 6 +++--- drivers/usb/host/ohci-q.c | 14 +++++++------- drivers/usb/image/mdc800.c | 26 ++++++++++++-------------- drivers/usb/image/microtek.c | 2 +- drivers/usb/input/aiptek.c | 10 +++++----- drivers/usb/input/hid-core.c | 10 ++++++++-- drivers/usb/input/powermate.c | 2 +- drivers/usb/media/ov511.c | 2 +- drivers/usb/media/pwc-ctrl.c | 2 +- drivers/usb/media/pwc-if.c | 3 ++- drivers/usb/misc/auerswald.c | 2 +- drivers/usb/misc/speedtch.c | 2 +- drivers/usb/misc/usbtest.c | 24 ++++++++++++------------ drivers/usb/net/kaweth.c | 2 +- drivers/usb/net/usbnet.c | 26 +++++++++++++------------- drivers/usb/storage/sddr09.c | 2 +- 22 files changed, 96 insertions(+), 91 deletions(-) diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c --- a/drivers/usb/class/usb-midi.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/class/usb-midi.c 2004-07-14 16:45:41 -07:00 @@ -951,7 +951,7 @@ if ( m->open_mode & FMODE_READ ) { unsigned long int flagsep; spin_lock_irqsave( &m->min.ep->lock, flagsep ); - m->min.ep->cables[m->min.cableId] = 0; // discard cable + m->min.ep->cables[m->min.cableId] = NULL; // discard cable m->min.ep->readers -= 1; m->open_mode &= ~FMODE_READ; if ( m->min.ep->readers == 0 && @@ -967,7 +967,7 @@ up(&open_sem); wake_up(&open_wait); - file->private_data = 0; + file->private_data = NULL; return 0; } @@ -1294,7 +1294,7 @@ unsigned char jack2string[256]; #endif - u = 0; + u = NULL; /* find audiocontrol interface */ p1 = find_csinterface_descriptor( buffer, bufSize, NULL, MS_HEADER, ifnum, altSetting); @@ -1314,7 +1314,7 @@ if ( !u ) { return NULL; } - u->deviceName = 0; + u->deviceName = NULL; u->idVendor = d->descriptor.idVendor; u->idProduct = d->descriptor.idProduct; u->interface = ifnum; @@ -1388,7 +1388,7 @@ if (quirks==0) { /* MIDISTREAM */ - p2 = 0; + p2 = NULL; for (p1 = find_descriptor(buffer, bufSize, NULL, USB_DT_ENDPOINT, ifnum, altSetting ); p1; p1 = next ) { next = find_descriptor(buffer, bufSize, p1, USB_DT_ENDPOINT, @@ -1397,7 +1397,7 @@ ifnum, altSetting ); if ( p2 && next && ( p2 > next ) ) - p2 = 0; + p2 = NULL; if ( p1[0] < 9 || !p2 || p2[0] < 4 ) continue; @@ -1940,8 +1940,8 @@ if ( ucable < 0 || ucable > 15 ) ucable = 0; - u.deviceName = 0; /* A flag for alloc_usb_midi_device to get device name - from device. */ + u.deviceName = NULL; /* A flag for alloc_usb_midi_device to get device name + from device. */ u.idVendor = uvendor; u.idProduct = uproduct; u.interface = uinterface; diff -Nru a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c --- a/drivers/usb/host/ehci-dbg.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ehci-dbg.c 2004-07-14 16:45:41 -07:00 @@ -536,7 +536,7 @@ if (p.qh->qh_next.ptr) temp = scnprintf (next, size, " ..."); - p.ptr = 0; + p.ptr = NULL; break; } /* show more info the first time around */ diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c --- a/drivers/usb/host/ehci-sched.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ehci-sched.c 2004-07-14 16:45:41 -07:00 @@ -1499,7 +1499,7 @@ list_del (&sitd->sitd_list); sitd_dma = sitd->sitd_dma; } else - sitd = 0; + sitd = NULL; if (!sitd) { spin_unlock_irqrestore (&ehci->lock, flags); @@ -1600,7 +1600,7 @@ hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs++; /* fill sITDs frame by frame */ - for (packet = 0, sitd = 0; + for (packet = 0, sitd = NULL; packet < urb->number_of_packets; packet++) { @@ -1626,7 +1626,7 @@ /* don't need that schedule data any more */ iso_sched_free (stream, sched); - urb->hcpriv = 0; + urb->hcpriv = NULL; timer_action (ehci, TIMER_IO_WATCHDOG); if (!ehci->periodic_sched++) @@ -1673,8 +1673,8 @@ } usb_put_urb (urb); - sitd->urb = 0; - sitd->stream = 0; + sitd->urb = NULL; + sitd->stream = NULL; list_move (&sitd->sitd_list, &stream->free_list); stream->depth -= stream->interval << 3; iso_stream_put (ehci, stream); @@ -1691,7 +1691,7 @@ /* give urb back to the driver */ dev = usb_get_dev (urb->dev); ehci_urb_done (ehci, urb, regs); - urb = 0; + urb = NULL; /* defer stopping schedule; completion can submit */ ehci->periodic_sched--; diff -Nru a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c --- a/drivers/usb/host/ohci-dbg.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ohci-dbg.c 2004-07-14 16:45:41 -07:00 @@ -266,11 +266,11 @@ ohci_dbg (controller, "OHCI controller state\n"); // dumps some of the state we know about - ohci_dump_status (controller, NULL, 0); + ohci_dump_status (controller, NULL, NULL); if (controller->hcca) ohci_dbg (controller, "hcca frame #%04x\n", OHCI_FRAME_NO(controller->hcca)); - ohci_dump_roothub (controller, 1, NULL, 0); + ohci_dump_roothub (controller, 1, NULL, NULL); } static const char data0 [] = "DATA0"; @@ -574,7 +574,7 @@ } else { /* we've seen it and what's after */ temp = 0; - ed = 0; + ed = NULL; } } while (ed); diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c --- a/drivers/usb/host/ohci-hcd.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ohci-hcd.c 2004-07-14 16:45:41 -07:00 @@ -229,7 +229,7 @@ if (urb->status != -EINPROGRESS) { spin_unlock (&urb->lock); urb->hcpriv = urb_priv; - finish_urb (ohci, urb, 0); + finish_urb (ohci, urb, NULL); retval = 0; goto fail; } @@ -341,7 +341,7 @@ if (!HCD_IS_RUNNING (ohci->hcd.state)) { ed->state = ED_IDLE; - finish_unlinks (ohci, 0, 0); + finish_unlinks (ohci, 0, NULL); } switch (ed->state) { @@ -369,7 +369,7 @@ td_free (ohci, ed->dummy); break; } - dev->ep [epnum] = 0; + dev->ep [epnum] = NULL; done: spin_unlock_irqrestore (&ohci->lock, flags); return; @@ -728,7 +728,7 @@ ed_deschedule (ohci, ed); ed->ed_next = ohci->ed_rm_list; - ed->ed_prev = 0; + ed->ed_prev = NULL; ohci->ed_rm_list = ed; /* FALLTHROUGH */ case ED_UNLINK: @@ -742,7 +742,7 @@ urb->status = -ESHUTDOWN; spin_unlock (&urb->lock); } - finish_unlinks (ohci, 0, 0); + finish_unlinks (ohci, 0, NULL); spin_unlock_irq(&ohci->lock); /* paranoia, in case that didn't work: */ diff -Nru a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c --- a/drivers/usb/host/ohci-hub.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ohci-hub.c 2004-07-14 16:45:41 -07:00 @@ -123,11 +123,11 @@ if (ohci_readl (&ohci->regs->intrstatus) & OHCI_INTR_SF) break; } - dl_done_list (ohci, 0); + dl_done_list (ohci, NULL); mdelay (7); } - dl_done_list (ohci, 0); - finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), 0); + dl_done_list (ohci, NULL); + finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), NULL); writel (ohci_readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus); /* maybe resume can wake root hub */ diff -Nru a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c --- a/drivers/usb/host/ohci-mem.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ohci-mem.c 2004-07-14 16:45:41 -07:00 @@ -36,7 +36,7 @@ INIT_WORK (&ohci->rh_resume, ohci_rh_resume, &ohci->hcd); return &ohci->hcd; } - return 0; + return NULL; } static void ohci_hcd_free (struct usb_hcd *hcd) @@ -69,11 +69,11 @@ { if (ohci->td_cache) { dma_pool_destroy (ohci->td_cache); - ohci->td_cache = 0; + ohci->td_cache = NULL; } if (ohci->ed_cache) { dma_pool_destroy (ohci->ed_cache); - ohci->ed_cache = 0; + ohci->ed_cache = NULL; } } diff -Nru a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c --- a/drivers/usb/host/ohci-q.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/host/ohci-q.c 2004-07-14 16:45:41 -07:00 @@ -174,8 +174,8 @@ return -EAGAIN; ed->state = ED_OPER; - ed->ed_prev = 0; - ed->ed_next = 0; + ed->ed_prev = NULL; + ed->ed_next = NULL; ed->hwNextED = 0; wmb (); @@ -333,7 +333,7 @@ if (ohci->ed_controltail == ed) { ohci->ed_controltail = ed->ed_prev; if (ohci->ed_controltail) - ohci->ed_controltail->ed_next = 0; + ohci->ed_controltail->ed_next = NULL; } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } @@ -357,7 +357,7 @@ if (ohci->ed_bulktail == ed) { ohci->ed_bulktail = ed->ed_prev; if (ohci->ed_bulktail) - ohci->ed_bulktail->ed_next = 0; + ohci->ed_bulktail->ed_next = NULL; } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } @@ -412,7 +412,7 @@ if (!td) { /* out of memory */ ed_free (ohci, ed); - ed = 0; + ed = NULL; goto done; } ed->dummy = td; @@ -474,7 +474,7 @@ /* rm_list is just singly linked, for simplicity */ ed->ed_next = ohci->ed_rm_list; - ed->ed_prev = 0; + ed->ed_prev = NULL; ohci->ed_rm_list = ed; /* enable SOF interrupt */ @@ -950,7 +950,7 @@ * entries (which we'd ignore), but paranoia won't hurt. */ *last = ed->ed_next; - ed->ed_next = 0; + ed->ed_next = NULL; modified = 0; /* unlink urbs as requested, but rescan the list after diff -Nru a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c --- a/drivers/usb/image/mdc800.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/image/mdc800.c 2004-07-14 16:45:41 -07:00 @@ -190,7 +190,7 @@ /* The Variable used by the driver */ -static struct mdc800_data* mdc800=0; +static struct mdc800_data* mdc800; /*************************************************************************** @@ -547,7 +547,7 @@ usb_unlink_urb (mdc800->write_urb); usb_unlink_urb (mdc800->download_urb); - mdc800->dev=0; + mdc800->dev = NULL; usb_set_intfdata(intf, NULL); } info ("Mustek MDC800 disconnected from USB."); @@ -972,8 +972,6 @@ *************************************************************************/ #define try(A) if ((A) == 0) goto cleanup_on_fail; -#define try_free_mem(A) if (A != 0) { kfree (A); A=0; } -#define try_free_urb(A) if (A != 0) { usb_free_urb (A); A=0; } static int __init usb_mdc800_init (void) { @@ -982,7 +980,7 @@ try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL)); memset(mdc800, 0, sizeof(struct mdc800_data)); - mdc800->dev=0; + mdc800->dev = NULL; mdc800->open=0; mdc800->state=NOT_CONNECTED; init_MUTEX (&mdc800->io_lock); @@ -1020,17 +1018,17 @@ { err ("can't alloc memory!"); - try_free_mem (mdc800->download_urb_buffer); - try_free_mem (mdc800->write_urb_buffer); - try_free_mem (mdc800->irq_urb_buffer); - - try_free_urb (mdc800->write_urb); - try_free_urb (mdc800->download_urb); - try_free_urb (mdc800->irq_urb); + kfree(mdc800->download_urb_buffer); + kfree(mdc800->write_urb_buffer); + kfree(mdc800->irq_urb_buffer); + + usb_free_urb(mdc800->write_urb); + usb_free_urb(mdc800->download_urb); + usb_free_urb(mdc800->irq_urb); kfree (mdc800); } - mdc800=0; + mdc800 = NULL; return retval; } @@ -1048,7 +1046,7 @@ kfree (mdc800->download_urb_buffer); kfree (mdc800); - mdc800=0; + mdc800 = NULL; } module_init (usb_mdc800_init); diff -Nru a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c --- a/drivers/usb/image/microtek.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/image/microtek.c 2004-07-14 16:45:41 -07:00 @@ -534,7 +534,7 @@ if (!srb->use_sg) { if ( !srb->bufflen ){ - desc->context.data = 0; + desc->context.data = NULL; desc->context.data_length = 0; return; } else { diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c --- a/drivers/usb/input/aiptek.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/input/aiptek.c 2004-07-14 16:45:41 -07:00 @@ -1324,7 +1324,7 @@ if (strcmp(buf, "disable") == 0) { aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; } else { - x = (int)simple_strtol(buf, 0, 10); + x = (int)simple_strtol(buf, NULL, 10); if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) { aiptek->newSetting.xTilt = x; } @@ -1366,7 +1366,7 @@ if (strcmp(buf, "disable") == 0) { aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; } else { - y = (int)simple_strtol(buf, 0, 10); + y = (int)simple_strtol(buf, NULL, 10); if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) { aiptek->newSetting.yTilt = y; } @@ -1399,7 +1399,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); return count; } @@ -1430,7 +1430,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); return count; } @@ -1805,7 +1805,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.wheel = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); return count; } diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c --- a/drivers/usb/input/hid-core.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/input/hid-core.c 2004-07-14 16:45:41 -07:00 @@ -807,7 +807,11 @@ unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; - __s32 value[count]; /* WARNING: gcc specific */ + __s32 *value; + + value = kmalloc(sizeof(__s32)*count, GFP_ATOMIC); + if (!value) + return; for (n = 0; n < count; n++) { @@ -817,7 +821,7 @@ if (!(field->flags & HID_MAIN_ITEM_VARIABLE) /* Ignore report if ErrorRollOver */ && value[n] >= min && value[n] <= max && field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) - return; + goto exit; } for (n = 0; n < count; n++) { @@ -847,6 +851,8 @@ } memcpy(field->value, value, count * sizeof(__s32)); +exit: + kfree(value); } static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs) diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c --- a/drivers/usb/input/powermate.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/input/powermate.c 2004-07-14 16:45:41 -07:00 @@ -182,7 +182,7 @@ pm->configcr->wLength = 0; usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), - (void *) pm->configcr, 0, 0, + (void *) pm->configcr, NULL, 0, powermate_config_complete, pm); pm->config->setup_dma = pm->configcr_dma; pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP; diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c --- a/drivers/usb/media/ov511.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/media/ov511.c 2004-07-14 16:45:41 -07:00 @@ -1900,7 +1900,7 @@ case SEN_KS0127: case SEN_KS0127B: case SEN_SAA7111A: - val = 0; + val = NULL; PDEBUG(3, "Unsupported with this sensor"); return -EPERM; default: diff -Nru a/drivers/usb/media/pwc-ctrl.c b/drivers/usb/media/pwc-ctrl.c --- a/drivers/usb/media/pwc-ctrl.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/media/pwc-ctrl.c 2004-07-14 16:45:41 -07:00 @@ -359,7 +359,7 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compression, int snapshot) { - struct Kiara_table_entry *pChoose = 0; + struct Kiara_table_entry *pChoose = NULL; int fps, ret; unsigned char buf[12]; struct Kiara_table_entry RawEntry = {6, 773, 1272, {0xAD, 0xF4, 0x10, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}}; diff -Nru a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c --- a/drivers/usb/media/pwc-if.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/media/pwc-if.c 2004-07-14 16:45:41 -07:00 @@ -593,7 +593,8 @@ int i, fst, flen; int awake; struct pwc_frame_buf *fbuf; - unsigned char *fillptr = 0, *iso_buf = 0; + unsigned char *fillptr = NULL; + unsigned char *iso_buf = NULL; awake = 0; pdev = (struct pwc_device *)urb->context; diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c --- a/drivers/usb/misc/auerswald.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/misc/auerswald.c 2004-07-14 16:45:41 -07:00 @@ -699,7 +699,7 @@ dr->wLength = cpu_to_le16 (size); usb_fill_control_urb (urb, dev, pipe, (unsigned char*)dr, data, size, /* build urb */ - auerchain_blocking_completion,0); + auerchain_blocking_completion, NULL); ret = auerchain_start_wait_urb (acp, urb, timeout, &length); usb_free_urb (urb); diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c --- a/drivers/usb/misc/speedtch.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/misc/speedtch.c 2004-07-14 16:45:41 -07:00 @@ -1149,7 +1149,7 @@ } /* ATM init */ - if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, 0))) { + if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, NULL))) { dbg ("udsl_usb_probe: failed to register ATM device!"); goto fail; } diff -Nru a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c --- a/drivers/usb/misc/usbtest.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/misc/usbtest.c 2004-07-14 16:45:41 -07:00 @@ -121,8 +121,8 @@ for (tmp = 0; tmp < intf->num_altsetting; tmp++) { unsigned ep; - in = out = 0; - iso_in = iso_out = 0; + in = out = NULL; + iso_in = iso_out = NULL; alt = intf->altsetting + tmp; /* take the first altsetting with in-bulk + out-bulk; @@ -216,11 +216,11 @@ struct urb *urb; if (bytes < 0) - return 0; + return NULL; urb = usb_alloc_urb (0, SLAB_KERNEL); if (!urb) return urb; - usb_fill_bulk_urb (urb, udev, pipe, 0, bytes, simple_callback, 0); + usb_fill_bulk_urb (urb, udev, pipe, NULL, bytes, simple_callback, NULL); urb->interval = (udev->speed == USB_SPEED_HIGH) ? (INTERRUPT_RATE << 3) : INTERRUPT_RATE; @@ -231,7 +231,7 @@ &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); - urb = 0; + urb = NULL; } else memset (urb->transfer_buffer, 0, bytes); return urb; @@ -380,7 +380,7 @@ sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); if (!sg) - return 0; + return NULL; memset (sg, 0, nents * sizeof *sg); for (i = 0; i < nents; i++) { @@ -389,7 +389,7 @@ buf = kmalloc (size, SLAB_KERNEL); if (!buf) { free_sglist (sg, i); - return 0; + return NULL; } memset (buf, 0, size); @@ -637,7 +637,7 @@ /* and sometimes [9.2.6.6] speed dependent descriptors */ if (udev->descriptor.bcdUSB == 0x0200) { /* pre-swapped */ - struct usb_qualifier_descriptor *d = 0; + struct usb_qualifier_descriptor *d = NULL; /* device qualifier [9.6.2] */ retval = usb_get_descriptor (udev, @@ -817,11 +817,11 @@ if ((status = usb_submit_urb (urb, SLAB_ATOMIC)) != 0) { dbg ("can't resubmit ctrl %02x.%02x, err %d", reqp->bRequestType, reqp->bRequest, status); - urb->dev = 0; + urb->dev = NULL; } else ctx->pending++; } else - urb->dev = 0; + urb->dev = NULL; /* signal completion when nothing's queued */ if (ctx->pending == 0) @@ -1368,7 +1368,7 @@ unsigned i, maxp, packets; if (bytes < 0 || !desc) - return 0; + return NULL; maxp = 0x7ff & desc->wMaxPacketSize; maxp *= 1 + (0x3 & (desc->wMaxPacketSize >> 11)); packets = (bytes + maxp - 1) / maxp; @@ -1385,7 +1385,7 @@ &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); - return 0; + return NULL; } memset (urb->transfer_buffer, 0, bytes); for (i = 0; i < packets; i++) { diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c --- a/drivers/usb/net/kaweth.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/net/kaweth.c 2004-07-14 16:45:41 -07:00 @@ -1293,7 +1293,7 @@ return -ENOMEM; usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char*)cmd, data, - len, usb_api_blocking_completion,0); + len, usb_api_blocking_completion, NULL); retv = usb_start_wait_urb(urb, timeout, &length); if (retv < 0) { diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c --- a/drivers/usb/net/usbnet.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/net/usbnet.c 2004-07-14 16:45:41 -07:00 @@ -316,7 +316,7 @@ for (tmp = 0; tmp < intf->num_altsetting; tmp++) { unsigned ep; - in = out = 0; + in = out = NULL; alt = intf->altsetting + tmp; /* take the first altsetting with in-bulk + out-bulk; @@ -1086,7 +1086,7 @@ /* ensure immediate exit from usbnet_disconnect */ usb_set_intfdata(info->data, NULL); usb_driver_release_interface (&usbnet_driver, info->data); - info->data = 0; + info->data = NULL; } /* and vice versa (just in case) */ @@ -1094,7 +1094,7 @@ /* ensure immediate exit from usbnet_disconnect */ usb_set_intfdata(info->control, NULL); usb_driver_release_interface (&usbnet_driver, info->control); - info->control = 0; + info->control = NULL; } } @@ -1641,7 +1641,7 @@ req, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, regnum, - 0, 0, // data is in setup packet + NULL, 0, // data is in setup packet CONTROL_TIMEOUT_JIFFIES); } @@ -2084,7 +2084,7 @@ req, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, val, index, - 0, 0, + NULL, 0, CONTROL_TIMEOUT_JIFFIES); } @@ -2418,7 +2418,7 @@ skb_put (skb, urb->actual_length); entry->state = rx_done; - entry->urb = 0; + entry->urb = NULL; switch (urb_status) { // success @@ -2462,7 +2462,7 @@ block: entry->state = rx_cleanup; entry->urb = urb; - urb = 0; + urb = NULL; break; // data overrun ... flush fifo? @@ -2557,7 +2557,7 @@ schedule_timeout (UNLINK_TIMEOUT_JIFFIES); devdbg (dev, "waited for %d urb completions", temp); } - dev->wait = 0; + dev->wait = NULL; remove_wait_queue (&unlink_wakeup, &wait); /* deferred work (task, timer, softirq) must also stop. @@ -2716,7 +2716,7 @@ /* tasklet could resubmit itself forever if memory is tight */ if (test_bit (EVENT_RX_MEMORY, &dev->flags)) { - struct urb *urb = 0; + struct urb *urb = NULL; if (netif_running (dev->net)) urb = usb_alloc_urb (0, GFP_KERNEL); @@ -2771,7 +2771,7 @@ } } - urb->dev = 0; + urb->dev = NULL; entry->state = tx_done; defer_bh (dev, skb); } @@ -2795,13 +2795,13 @@ struct usbnet *dev = (struct usbnet *) net->priv; int length; int retval = NET_XMIT_SUCCESS; - struct urb *urb = 0; + struct urb *urb = NULL; struct skb_data *entry; struct driver_info *info = dev->driver_info; unsigned long flags; #ifdef CONFIG_USB_NET1080 - struct nc_header *header = 0; - struct nc_trailer *trailer = 0; + struct nc_header *header = NULL; + struct nc_trailer *trailer = NULL; #endif /* CONFIG_USB_NET1080 */ // some devices want funky USB-level framing, for diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c --- a/drivers/usb/storage/sddr09.c 2004-07-14 16:45:41 -07:00 +++ b/drivers/usb/storage/sddr09.c 2004-07-14 16:45:41 -07:00 @@ -1089,7 +1089,7 @@ if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result of read_deviceID is %d\n", result); printk("sddr09: could not read card info\n"); - return 0; + return NULL; } sprintf(blurbtxt, "sddr09: Found Flash card, ID = %02X %02X %02X %02X",