]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Staging: line6: fix up NULL assignment mistakes
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 28 Feb 2009 04:49:46 +0000 (20:49 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:54:25 +0000 (14:54 -0700)
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: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/line6/audio.c
drivers/staging/line6/capture.c
drivers/staging/line6/driver.c
drivers/staging/line6/midibuf.c
drivers/staging/line6/playback.c
drivers/staging/line6/toneport.c

index d035420c7bfbf1e6d076d7302ac663ee56b1e1c4..37f759a76158af37366ce1817cb634cf3225146b 100644 (file)
@@ -62,10 +62,10 @@ void line6_cleanup_audio(struct usb_line6 *line6)
 {
        struct snd_card *card = line6->card;
 
-       if(card == 0)
+       if (card == NULL)
                return;
 
        snd_card_disconnect(card);
        snd_card_free(card);
-       line6->card = 0;
+       line6->card = NULL;
 }
index a4628bd61cacbffc7384f4b190645118118182aa..d6c1d1a7045976e720810eb90c3ae7e1ccb0939a 100644 (file)
@@ -279,7 +279,7 @@ static int snd_line6_capture_hw_free(struct snd_pcm_substream *substream)
 
        if(line6pcm->buffer_in) {
                kfree(line6pcm->buffer_in);
-               line6pcm->buffer_in = 0;
+               line6pcm->buffer_in = NULL;
        }
 
        return snd_pcm_lib_free_pages(substream);
index cf01abcc46763f97c68a5ac2b612df27c907361b..0484ee60778da6c2b8b3e6973c0964c10fe4570b 100644 (file)
@@ -301,7 +301,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, in
 
        if(!buffer) {
                dev_err(line6->ifcdev, "out of memory\n");
-               return 0;
+               return NULL;
        }
 
        buffer[0] = LINE6_SYSEX_BEGIN;
@@ -469,7 +469,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t dat
        /* query the serial number: */
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
                                                                                                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) {
                dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
@@ -630,8 +630,8 @@ static void line6_list_devices(void)
 static int line6_probe(struct usb_interface *interface, const struct usb_device_id *id)
 {
        int devtype;
-       struct usb_device *usbdev = 0;
-       struct usb_line6 *line6 = 0;
+       struct usb_device *usbdev = NULL;
+       struct usb_line6 *line6 = NULL;
        const struct line6_properties *properties;
        int devnum;
        int interface_number, alternate = 0;
@@ -987,7 +987,7 @@ static void line6_disconnect(struct usb_interface *interface)
 
                for(i = LINE6_MAX_DEVICES; i--;)
                        if(line6_devices[i] == line6)
-                               line6_devices[i] = 0;
+                               line6_devices[i] = NULL;
        }
 
        line6_destruct(interface);
@@ -1016,13 +1016,13 @@ static int __init line6_init(void)
        printk("%s driver version %s%s\n", DRIVER_NAME, DRIVER_VERSION, DRIVER_REVISION);
        line6_workqueue = create_workqueue(DRIVER_NAME);
 
-       if(line6_workqueue == 0) {
+       if (line6_workqueue == NULL) {
                err("couldn't create workqueue");
                return -EINVAL;
        }
 
        for(i = LINE6_MAX_DEVICES; i--;)
-               line6_devices[i] = 0;
+               line6_devices[i] = NULL;
 
        retval = usb_register(&line6_driver);
 
index 1f5934e32124d0a1aadcb1de49bf313c362052c5..5726bb148a5a6ea1bac7011e911462042dbbf104 100644 (file)
@@ -44,7 +44,7 @@ int midibuf_init(struct MidiBuffer *this, int size, int split)
 {
        this->buf = (unsigned char *)kmalloc(size, GFP_KERNEL);
 
-       if(this->buf == 0)
+       if (this->buf == NULL)
                return -ENOMEM;
 
        this->size = size;
@@ -261,8 +261,6 @@ int midibuf_skip_message(struct MidiBuffer *this, unsigned short mask)
 
 void midibuf_destroy(struct MidiBuffer *this)
 {
-       if(this->buf != 0) {
-               kfree(this->buf);
-               this->buf = 0;
-       }
+       kfree(this->buf);
+       this->buf = NULL;
 }
index c30c627efdd78894b5fe8a18a72dda520e99fa4d..34cfbdbb15a231f13ac27c2da62de003bd289c79 100644 (file)
@@ -329,7 +329,7 @@ static int snd_line6_playback_hw_free(struct snd_pcm_substream *substream)
 
        if(line6pcm->wrap_out) {
                kfree(line6pcm->wrap_out);
-               line6pcm->wrap_out = 0;
+               line6pcm->wrap_out = NULL;
        }
 
        return snd_pcm_lib_free_pages(substream);
index 041b2c8d1432cdf6f60b4cd85c3dd72a27655196..d894f4851ef2b341097380508d3c416265f61cd3 100644 (file)
@@ -117,7 +117,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2)
        int ret;
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev,0), 0x67,
                                                                                                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)     {
                err("send failed (error %d)\n", ret);