Commit 536165d8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: line6: fix up NULL assignment mistakes

Should use NULL for a pointer, not 0, otherwise sparse complains.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b702ed25
...@@ -62,10 +62,10 @@ void line6_cleanup_audio(struct usb_line6 *line6) ...@@ -62,10 +62,10 @@ void line6_cleanup_audio(struct usb_line6 *line6)
{ {
struct snd_card *card = line6->card; struct snd_card *card = line6->card;
if(card == 0) if (card == NULL)
return; return;
snd_card_disconnect(card); snd_card_disconnect(card);
snd_card_free(card); snd_card_free(card);
line6->card = 0; line6->card = NULL;
} }
...@@ -279,7 +279,7 @@ static int snd_line6_capture_hw_free(struct snd_pcm_substream *substream) ...@@ -279,7 +279,7 @@ static int snd_line6_capture_hw_free(struct snd_pcm_substream *substream)
if(line6pcm->buffer_in) { if(line6pcm->buffer_in) {
kfree(line6pcm->buffer_in); kfree(line6pcm->buffer_in);
line6pcm->buffer_in = 0; line6pcm->buffer_in = NULL;
} }
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
......
...@@ -301,7 +301,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, in ...@@ -301,7 +301,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, in
if(!buffer) { if(!buffer) {
dev_err(line6->ifcdev, "out of memory\n"); dev_err(line6->ifcdev, "out of memory\n");
return 0; return NULL;
} }
buffer[0] = LINE6_SYSEX_BEGIN; buffer[0] = LINE6_SYSEX_BEGIN;
...@@ -469,7 +469,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t dat ...@@ -469,7 +469,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t dat
/* query the serial number: */ /* query the serial number: */
ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
(datalen << 8) | 0x21, address, 0, 0, LINE6_TIMEOUT * HZ); (datalen << 8) | 0x21, address, NULL, 0, LINE6_TIMEOUT * HZ);
if(ret < 0) { if(ret < 0) {
dev_err(line6->ifcdev, "read request failed (error %d)\n", ret); dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
...@@ -630,8 +630,8 @@ static void line6_list_devices(void) ...@@ -630,8 +630,8 @@ static void line6_list_devices(void)
static int line6_probe(struct usb_interface *interface, const struct usb_device_id *id) static int line6_probe(struct usb_interface *interface, const struct usb_device_id *id)
{ {
int devtype; int devtype;
struct usb_device *usbdev = 0; struct usb_device *usbdev = NULL;
struct usb_line6 *line6 = 0; struct usb_line6 *line6 = NULL;
const struct line6_properties *properties; const struct line6_properties *properties;
int devnum; int devnum;
int interface_number, alternate = 0; int interface_number, alternate = 0;
...@@ -987,7 +987,7 @@ static void line6_disconnect(struct usb_interface *interface) ...@@ -987,7 +987,7 @@ static void line6_disconnect(struct usb_interface *interface)
for(i = LINE6_MAX_DEVICES; i--;) for(i = LINE6_MAX_DEVICES; i--;)
if(line6_devices[i] == line6) if(line6_devices[i] == line6)
line6_devices[i] = 0; line6_devices[i] = NULL;
} }
line6_destruct(interface); line6_destruct(interface);
...@@ -1016,13 +1016,13 @@ static int __init line6_init(void) ...@@ -1016,13 +1016,13 @@ static int __init line6_init(void)
printk("%s driver version %s%s\n", DRIVER_NAME, DRIVER_VERSION, DRIVER_REVISION); printk("%s driver version %s%s\n", DRIVER_NAME, DRIVER_VERSION, DRIVER_REVISION);
line6_workqueue = create_workqueue(DRIVER_NAME); line6_workqueue = create_workqueue(DRIVER_NAME);
if(line6_workqueue == 0) { if (line6_workqueue == NULL) {
err("couldn't create workqueue"); err("couldn't create workqueue");
return -EINVAL; return -EINVAL;
} }
for(i = LINE6_MAX_DEVICES; i--;) for(i = LINE6_MAX_DEVICES; i--;)
line6_devices[i] = 0; line6_devices[i] = NULL;
retval = usb_register(&line6_driver); retval = usb_register(&line6_driver);
......
...@@ -44,7 +44,7 @@ int midibuf_init(struct MidiBuffer *this, int size, int split) ...@@ -44,7 +44,7 @@ int midibuf_init(struct MidiBuffer *this, int size, int split)
{ {
this->buf = (unsigned char *)kmalloc(size, GFP_KERNEL); this->buf = (unsigned char *)kmalloc(size, GFP_KERNEL);
if(this->buf == 0) if (this->buf == NULL)
return -ENOMEM; return -ENOMEM;
this->size = size; this->size = size;
...@@ -261,8 +261,6 @@ int midibuf_skip_message(struct MidiBuffer *this, unsigned short mask) ...@@ -261,8 +261,6 @@ int midibuf_skip_message(struct MidiBuffer *this, unsigned short mask)
void midibuf_destroy(struct MidiBuffer *this) void midibuf_destroy(struct MidiBuffer *this)
{ {
if(this->buf != 0) {
kfree(this->buf); kfree(this->buf);
this->buf = 0; this->buf = NULL;
}
} }
...@@ -329,7 +329,7 @@ static int snd_line6_playback_hw_free(struct snd_pcm_substream *substream) ...@@ -329,7 +329,7 @@ static int snd_line6_playback_hw_free(struct snd_pcm_substream *substream)
if(line6pcm->wrap_out) { if(line6pcm->wrap_out) {
kfree(line6pcm->wrap_out); kfree(line6pcm->wrap_out);
line6pcm->wrap_out = 0; line6pcm->wrap_out = NULL;
} }
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
......
...@@ -117,7 +117,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2) ...@@ -117,7 +117,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2)
int ret; int ret;
ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev,0), 0x67, ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev,0), 0x67,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
cmd1, cmd2, 0, 0, LINE6_TIMEOUT * HZ); cmd1, cmd2, NULL, 0, LINE6_TIMEOUT * HZ);
if(ret < 0) { if(ret < 0) {
err("send failed (error %d)\n", ret); err("send failed (error %d)\n", ret);
......
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