diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-27 23:49:46 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 17:54:25 -0400 |
commit | 536165d8ef6933131bf7166338eafa77b75f8bb7 (patch) | |
tree | bd810f758fbf318006712ff8b266cd29be24e5c7 | |
parent | b702ed253d33d056987e92299687d8ed85195896 (diff) |
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: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/line6/audio.c | 4 | ||||
-rw-r--r-- | drivers/staging/line6/capture.c | 2 | ||||
-rw-r--r-- | drivers/staging/line6/driver.c | 14 | ||||
-rw-r--r-- | drivers/staging/line6/midibuf.c | 8 | ||||
-rw-r--r-- | drivers/staging/line6/playback.c | 2 | ||||
-rw-r--r-- | drivers/staging/line6/toneport.c | 2 |
6 files changed, 15 insertions, 17 deletions
diff --git a/drivers/staging/line6/audio.c b/drivers/staging/line6/audio.c index d035420c7bfb..37f759a76158 100644 --- a/drivers/staging/line6/audio.c +++ b/drivers/staging/line6/audio.c | |||
@@ -62,10 +62,10 @@ void line6_cleanup_audio(struct usb_line6 *line6) | |||
62 | { | 62 | { |
63 | struct snd_card *card = line6->card; | 63 | struct snd_card *card = line6->card; |
64 | 64 | ||
65 | if(card == 0) | 65 | if (card == NULL) |
66 | return; | 66 | return; |
67 | 67 | ||
68 | snd_card_disconnect(card); | 68 | snd_card_disconnect(card); |
69 | snd_card_free(card); | 69 | snd_card_free(card); |
70 | line6->card = 0; | 70 | line6->card = NULL; |
71 | } | 71 | } |
diff --git a/drivers/staging/line6/capture.c b/drivers/staging/line6/capture.c index a4628bd61cac..d6c1d1a70459 100644 --- a/drivers/staging/line6/capture.c +++ b/drivers/staging/line6/capture.c | |||
@@ -279,7 +279,7 @@ static int snd_line6_capture_hw_free(struct snd_pcm_substream *substream) | |||
279 | 279 | ||
280 | if(line6pcm->buffer_in) { | 280 | if(line6pcm->buffer_in) { |
281 | kfree(line6pcm->buffer_in); | 281 | kfree(line6pcm->buffer_in); |
282 | line6pcm->buffer_in = 0; | 282 | line6pcm->buffer_in = NULL; |
283 | } | 283 | } |
284 | 284 | ||
285 | return snd_pcm_lib_free_pages(substream); | 285 | return snd_pcm_lib_free_pages(substream); |
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index cf01abcc4676..0484ee60778d 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c | |||
@@ -301,7 +301,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, in | |||
301 | 301 | ||
302 | if(!buffer) { | 302 | if(!buffer) { |
303 | dev_err(line6->ifcdev, "out of memory\n"); | 303 | dev_err(line6->ifcdev, "out of memory\n"); |
304 | return 0; | 304 | return NULL; |
305 | } | 305 | } |
306 | 306 | ||
307 | buffer[0] = LINE6_SYSEX_BEGIN; | 307 | 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 | /* query the serial number: */ | 469 | /* query the serial number: */ |
470 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, | 470 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, |
471 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, | 471 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, |
472 | (datalen << 8) | 0x21, address, 0, 0, LINE6_TIMEOUT * HZ); | 472 | (datalen << 8) | 0x21, address, NULL, 0, LINE6_TIMEOUT * HZ); |
473 | 473 | ||
474 | if(ret < 0) { | 474 | if(ret < 0) { |
475 | dev_err(line6->ifcdev, "read request failed (error %d)\n", ret); | 475 | dev_err(line6->ifcdev, "read request failed (error %d)\n", ret); |
@@ -630,8 +630,8 @@ static void line6_list_devices(void) | |||
630 | static int line6_probe(struct usb_interface *interface, const struct usb_device_id *id) | 630 | static int line6_probe(struct usb_interface *interface, const struct usb_device_id *id) |
631 | { | 631 | { |
632 | int devtype; | 632 | int devtype; |
633 | struct usb_device *usbdev = 0; | 633 | struct usb_device *usbdev = NULL; |
634 | struct usb_line6 *line6 = 0; | 634 | struct usb_line6 *line6 = NULL; |
635 | const struct line6_properties *properties; | 635 | const struct line6_properties *properties; |
636 | int devnum; | 636 | int devnum; |
637 | int interface_number, alternate = 0; | 637 | int interface_number, alternate = 0; |
@@ -987,7 +987,7 @@ static void line6_disconnect(struct usb_interface *interface) | |||
987 | 987 | ||
988 | for(i = LINE6_MAX_DEVICES; i--;) | 988 | for(i = LINE6_MAX_DEVICES; i--;) |
989 | if(line6_devices[i] == line6) | 989 | if(line6_devices[i] == line6) |
990 | line6_devices[i] = 0; | 990 | line6_devices[i] = NULL; |
991 | } | 991 | } |
992 | 992 | ||
993 | line6_destruct(interface); | 993 | line6_destruct(interface); |
@@ -1016,13 +1016,13 @@ static int __init line6_init(void) | |||
1016 | printk("%s driver version %s%s\n", DRIVER_NAME, DRIVER_VERSION, DRIVER_REVISION); | 1016 | printk("%s driver version %s%s\n", DRIVER_NAME, DRIVER_VERSION, DRIVER_REVISION); |
1017 | line6_workqueue = create_workqueue(DRIVER_NAME); | 1017 | line6_workqueue = create_workqueue(DRIVER_NAME); |
1018 | 1018 | ||
1019 | if(line6_workqueue == 0) { | 1019 | if (line6_workqueue == NULL) { |
1020 | err("couldn't create workqueue"); | 1020 | err("couldn't create workqueue"); |
1021 | return -EINVAL; | 1021 | return -EINVAL; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | for(i = LINE6_MAX_DEVICES; i--;) | 1024 | for(i = LINE6_MAX_DEVICES; i--;) |
1025 | line6_devices[i] = 0; | 1025 | line6_devices[i] = NULL; |
1026 | 1026 | ||
1027 | retval = usb_register(&line6_driver); | 1027 | retval = usb_register(&line6_driver); |
1028 | 1028 | ||
diff --git a/drivers/staging/line6/midibuf.c b/drivers/staging/line6/midibuf.c index 1f5934e32124..5726bb148a5a 100644 --- a/drivers/staging/line6/midibuf.c +++ b/drivers/staging/line6/midibuf.c | |||
@@ -44,7 +44,7 @@ int midibuf_init(struct MidiBuffer *this, int size, int split) | |||
44 | { | 44 | { |
45 | this->buf = (unsigned char *)kmalloc(size, GFP_KERNEL); | 45 | this->buf = (unsigned char *)kmalloc(size, GFP_KERNEL); |
46 | 46 | ||
47 | if(this->buf == 0) | 47 | if (this->buf == NULL) |
48 | return -ENOMEM; | 48 | return -ENOMEM; |
49 | 49 | ||
50 | this->size = size; | 50 | this->size = size; |
@@ -261,8 +261,6 @@ int midibuf_skip_message(struct MidiBuffer *this, unsigned short mask) | |||
261 | 261 | ||
262 | void midibuf_destroy(struct MidiBuffer *this) | 262 | void midibuf_destroy(struct MidiBuffer *this) |
263 | { | 263 | { |
264 | if(this->buf != 0) { | 264 | kfree(this->buf); |
265 | kfree(this->buf); | 265 | this->buf = NULL; |
266 | this->buf = 0; | ||
267 | } | ||
268 | } | 266 | } |
diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c index c30c627efdd7..34cfbdbb15a2 100644 --- a/drivers/staging/line6/playback.c +++ b/drivers/staging/line6/playback.c | |||
@@ -329,7 +329,7 @@ static int snd_line6_playback_hw_free(struct snd_pcm_substream *substream) | |||
329 | 329 | ||
330 | if(line6pcm->wrap_out) { | 330 | if(line6pcm->wrap_out) { |
331 | kfree(line6pcm->wrap_out); | 331 | kfree(line6pcm->wrap_out); |
332 | line6pcm->wrap_out = 0; | 332 | line6pcm->wrap_out = NULL; |
333 | } | 333 | } |
334 | 334 | ||
335 | return snd_pcm_lib_free_pages(substream); | 335 | return snd_pcm_lib_free_pages(substream); |
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index 041b2c8d1432..d894f4851ef2 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c | |||
@@ -117,7 +117,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2) | |||
117 | int ret; | 117 | int ret; |
118 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev,0), 0x67, | 118 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev,0), 0x67, |
119 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, | 119 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, |
120 | cmd1, cmd2, 0, 0, LINE6_TIMEOUT * HZ); | 120 | cmd1, cmd2, NULL, 0, LINE6_TIMEOUT * HZ); |
121 | 121 | ||
122 | if(ret < 0) { | 122 | if(ret < 0) { |
123 | err("send failed (error %d)\n", ret); | 123 | err("send failed (error %d)\n", ret); |