Commit 52db091e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: more sparse cleanups (all pretty much NULL usages.)

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 213aaf83
......@@ -951,7 +951,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
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 @@ static int usb_midi_release(struct inode *inode, struct file *file)
up(&open_sem);
wake_up(&open_wait);
file->private_data = 0;
file->private_data = NULL;
return 0;
}
......@@ -1294,7 +1294,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
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 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
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 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
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 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
ifnum, altSetting );
if ( p2 && next && ( p2 > next ) )
p2 = 0;
p2 = NULL;
if ( p1[0] < 9 || !p2 || p2[0] < 4 )
continue;
......@@ -1940,8 +1940,8 @@ static int detect_by_hand(struct usb_device *d, unsigned int ifnum, struct usb_m
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;
......
......@@ -536,7 +536,7 @@ show_periodic (struct class_device *class_dev, char *buf)
if (p.qh->qh_next.ptr)
temp = scnprintf (next, size,
" ...");
p.ptr = 0;
p.ptr = NULL;
break;
}
/* show more info the first time around */
......
......@@ -1499,7 +1499,7 @@ sitd_urb_transaction (
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 @@ sitd_link_urb (
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 @@ sitd_link_urb (
/* 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 @@ sitd_complete (
}
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 @@ sitd_complete (
/* 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--;
......
......@@ -266,11 +266,11 @@ static void ohci_dump (struct ohci_hcd *controller, int verbose)
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 @@ show_periodic (struct class_device *class_dev, char *buf)
} else {
/* we've seen it and what's after */
temp = 0;
ed = 0;
ed = NULL;
}
} while (ed);
......
......@@ -229,7 +229,7 @@ static int ohci_urb_enqueue (
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 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
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 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
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 @@ static int hc_restart (struct ohci_hcd *ohci)
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 @@ static int hc_restart (struct ohci_hcd *ohci)
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: */
......
......@@ -123,11 +123,11 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
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 */
......
......@@ -36,7 +36,7 @@ static struct usb_hcd *ohci_hcd_alloc (void)
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 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
{
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;
}
}
......
......@@ -174,8 +174,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
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 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
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 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
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 @@ static struct ed *ed_get (
if (!td) {
/* out of memory */
ed_free (ohci, ed);
ed = 0;
ed = NULL;
goto done;
}
ed->dummy = td;
......@@ -474,7 +474,7 @@ static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed)
/* 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 @@ finish_unlinks (struct ohci_hcd *ohci, u16 tick, struct pt_regs *regs)
* 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
......
......@@ -190,7 +190,7 @@ static struct usb_endpoint_descriptor mdc800_ed [4] =
/* The Variable used by the driver */
static struct mdc800_data* mdc800=0;
static struct mdc800_data* mdc800;
/***************************************************************************
......@@ -547,7 +547,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
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 @@ static struct usb_driver mdc800_usb_driver =
*************************************************************************/
#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 @@ static int __init usb_mdc800_init (void)
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 @@ static int __init usb_mdc800_init (void)
{
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);
kfree(mdc800->download_urb_buffer);
kfree(mdc800->write_urb_buffer);
kfree(mdc800->irq_urb_buffer);
try_free_urb (mdc800->write_urb);
try_free_urb (mdc800->download_urb);
try_free_urb (mdc800->irq_urb);
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 @@ static void __exit usb_mdc800_cleanup (void)
kfree (mdc800->download_urb_buffer);
kfree (mdc800);
mdc800=0;
mdc800 = NULL;
}
module_init (usb_mdc800_init);
......
......@@ -534,7 +534,7 @@ mts_build_transfer_context( Scsi_Cmnd *srb, struct mts_desc* desc )
if (!srb->use_sg) {
if ( !srb->bufflen ){
desc->context.data = 0;
desc->context.data = NULL;
desc->context.data_length = 0;
return;
} else {
......
......@@ -1324,7 +1324,7 @@ store_tabletXtilt(struct device *dev, const char *buf, size_t count)
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 @@ store_tabletYtilt(struct device *dev, const char *buf, size_t count)
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 @@ store_tabletJitterDelay(struct device *dev, const char *buf, size_t count)
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 @@ store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count)
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 @@ store_tabletWheel(struct device *dev, const char *buf, size_t count)
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;
}
......
......@@ -807,7 +807,11 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
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 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
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 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
}
memcpy(field->value, value, count * sizeof(__s32));
exit:
kfree(value);
}
static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs)
......
......@@ -182,7 +182,7 @@ static void powermate_sync_state(struct powermate_device *pm)
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;
......
......@@ -1900,7 +1900,7 @@ sensor_get_exposure(struct usb_ov511 *ov, unsigned char *val)
case SEN_KS0127:
case SEN_KS0127B:
case SEN_SAA7111A:
val = 0;
val = NULL;
PDEBUG(3, "Unsupported with this sensor");
return -EPERM;
default:
......
......@@ -359,7 +359,7 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
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}};
......
......@@ -593,7 +593,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
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;
......
......@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
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);
......
......@@ -1149,7 +1149,7 @@ static int udsl_usb_probe (struct usb_interface *intf, const struct usb_device_i
}
/* 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;
}
......
......@@ -121,8 +121,8 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
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 @@ static struct urb *simple_alloc_urb (
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 @@ static struct urb *simple_alloc_urb (
&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 @@ alloc_sglist (int nents, int max, int vary)
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 @@ alloc_sglist (int nents, int max, int vary)
buf = kmalloc (size, SLAB_KERNEL);
if (!buf) {
free_sglist (sg, i);
return 0;
return NULL;
}
memset (buf, 0, size);
......@@ -637,7 +637,7 @@ static int ch9_postconfig (struct usbtest_dev *dev)
/* 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 @@ static void ctrl_complete (struct urb *urb, struct pt_regs *regs)
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 @@ static struct urb *iso_alloc_urb (
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 @@ static struct urb *iso_alloc_urb (
&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++) {
......
......@@ -1293,7 +1293,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
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) {
......
......@@ -316,7 +316,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
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 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
/* 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 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
/* 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 @@ nc_vendor_write (struct usbnet *dev, u8 req, u8 regnum, u16 value)
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 @@ pl_vendor_req (struct usbnet *dev, u8 req, u8 val, u8 index)
req,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
val, index,
0, 0,
NULL, 0,
CONTROL_TIMEOUT_JIFFIES);
}
......@@ -2418,7 +2418,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
skb_put (skb, urb->actual_length);
entry->state = rx_done;
entry->urb = 0;
entry->urb = NULL;
switch (urb_status) {
// success
......@@ -2462,7 +2462,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
block:
entry->state = rx_cleanup;
entry->urb = urb;
urb = 0;
urb = NULL;
break;
// data overrun ... flush fifo?
......@@ -2557,7 +2557,7 @@ static int usbnet_stop (struct net_device *net)
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 @@ kevent (void *data)
/* 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 @@ static void tx_complete (struct urb *urb, struct pt_regs *regs)
}
}
urb->dev = 0;
urb->dev = NULL;
entry->state = tx_done;
defer_bh (dev, skb);
}
......@@ -2795,13 +2795,13 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
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
......
......@@ -1089,7 +1089,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment