Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754434Ab0LGWiI (ORCPT ); Tue, 7 Dec 2010 17:38:08 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]:53526 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1753422Ab0LGWiH (ORCPT ); Tue, 7 Dec 2010 17:38:07 -0500 X-Authenticated: #12255092 X-Provags-ID: V01U2FsdGVkX1/TwVJRm5DTpUEEWNSVjva4iBFqfCzcRTsNVxFsSG DeHQABh9X31Bz/ From: Peter Huewe To: Greg Kroah-Hartman Cc: Markus Grabner , Shawn Bohrer , Tejun Heo , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Peter Huewe Subject: [PATCH] staging/line6: Fix sparse warning 'Using plain integer as NULL pointer' Date: Tue, 7 Dec 2010 23:38:02 +0100 Message-Id: <1291761482-28500-1-git-send-email-peterhuewe@gmx.de> X-Mailer: git-send-email 1.7.2.2 X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2560 Lines: 70 This patch fixes the warning generated by sparse: "Using plain integer as NULL pointer" by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe --- KernelVersion: linux-next-20101207 (line6 staging driver does currently _not_ build, but this is not caused by this patch. Maybe I'll have a look at it.) drivers/staging/line6/capture.c | 2 +- drivers/staging/line6/midi.c | 4 ++-- drivers/staging/line6/playback.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/line6/capture.c b/drivers/staging/line6/capture.c index 1e3bb14..9647154 100644 --- a/drivers/staging/line6/capture.c +++ b/drivers/staging/line6/capture.c @@ -147,7 +147,7 @@ void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf, int fsize) const int bytes_per_frame = line6pcm->properties->bytes_per_frame; int frames = fsize / bytes_per_frame; - if (runtime == 0) + if (runtime == NULL) return; if (line6pcm->pos_in_done + frames > runtime->buffer_size) { diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c index ab67e88..e554a2d 100644 --- a/drivers/staging/line6/midi.c +++ b/drivers/staging/line6/midi.c @@ -127,7 +127,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, urb = usb_alloc_urb(0, GFP_ATOMIC); - if (urb == 0) { + if (urb == NULL) { dev_err(line6->ifcdev, "Out of memory\n"); return -ENOMEM; } @@ -137,7 +137,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, transfer_buffer = kmalloc(length, GFP_ATOMIC); - if (transfer_buffer == 0) { + if (transfer_buffer == NULL) { usb_free_urb(urb); dev_err(line6->ifcdev, "Out of memory\n"); return -ENOMEM; diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c index 29940fd..10c5438 100644 --- a/drivers/staging/line6/playback.c +++ b/drivers/staging/line6/playback.c @@ -246,7 +246,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) change_volume(urb_out, line6pcm->volume_playback, bytes_per_frame); - if (line6pcm->prev_fbuf != 0) { + if (line6pcm->prev_fbuf != NULL) { #ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE if (line6pcm->flags & MASK_PCM_IMPULSE) { create_impulse_test_signal(line6pcm, urb_out, -- 1.7.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/