From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-usb@vger.kernel.org, Stefani Seibold <stefani@seibold.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 3/3] kfifo: Don't use integer as NULL pointer
Date: Wed, 27 Jan 2010 17:09:38 +0300 [thread overview]
Message-ID: <20100127140938.GC31608@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100127140809.GA27906@oksana.dev.rtsoft.ru>
This patch fixes following sparse warnings:
include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer
kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
include/linux/kfifo.h | 2 +-
kernel/kfifo.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 6f6c5f3..bc0fc79 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo,
*/
static inline bool kfifo_initialized(struct kfifo *fifo)
{
- return fifo->buffer != 0;
+ return fifo->buffer != NULL;
}
/**
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 3b00bf8..6d58e1a 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)
buffer = kmalloc(size, gfp_mask);
if (!buffer) {
- _kfifo_init(fifo, 0, 0);
+ _kfifo_init(fifo, NULL, 0);
return -ENOMEM;
}
--
1.6.5.7
WARNING: multiple messages have this Message-ID (diff)
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Josh Boyer <jwboyer@gmail.com>,
Stefani Seibold <stefani@seibold.net>,
linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: [PATCH 3/3] kfifo: Don't use integer as NULL pointer
Date: Wed, 27 Jan 2010 17:09:38 +0300 [thread overview]
Message-ID: <20100127140938.GC31608@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100127140809.GA27906@oksana.dev.rtsoft.ru>
This patch fixes following sparse warnings:
include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer
kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
include/linux/kfifo.h | 2 +-
kernel/kfifo.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 6f6c5f3..bc0fc79 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo,
*/
static inline bool kfifo_initialized(struct kfifo *fifo)
{
- return fifo->buffer != 0;
+ return fifo->buffer != NULL;
}
/**
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 3b00bf8..6d58e1a 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)
buffer = kmalloc(size, gfp_mask);
if (!buffer) {
- _kfifo_init(fifo, 0, 0);
+ _kfifo_init(fifo, NULL, 0);
return -ENOMEM;
}
--
1.6.5.7
next prev parent reply other threads:[~2010-01-27 14:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 14:08 [PATCH 0/3 for 2.6.33] Some fixes for kfifo and FHCI Anton Vorontsov
2010-01-27 14:08 ` Anton Vorontsov
2010-01-27 14:09 ` [PATCH 1/3] kfifo: Make kfifo_initialized work after kfifo_free Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov
2010-01-27 14:09 ` [PATCH 2/3] USB: FHCI: Fix build after kfifo rework Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov
2010-01-27 14:09 ` Anton Vorontsov [this message]
2010-01-27 14:09 ` [PATCH 3/3] kfifo: Don't use integer as NULL pointer Anton Vorontsov
2010-01-27 14:50 ` [PATCH 0/3 for 2.6.33] Some fixes for kfifo and FHCI Greg KH
2010-01-27 14:50 ` Greg KH
2010-01-27 15:47 ` Stefani Seibold
2010-01-27 15:47 ` Stefani Seibold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100127140938.GC31608@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=stefani@seibold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.