Commit 5a5e0f4c authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Greg Kroah-Hartman

kfifo: Don't use integer as NULL pointer

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: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: default avatarStefani Seibold <stefani@seibold.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4c743d0a
...@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, ...@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo,
*/ */
static inline bool kfifo_initialized(struct kfifo *fifo) static inline bool kfifo_initialized(struct kfifo *fifo)
{ {
return fifo->buffer != 0; return fifo->buffer != NULL;
} }
/** /**
......
...@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask) ...@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)
buffer = kmalloc(size, gfp_mask); buffer = kmalloc(size, gfp_mask);
if (!buffer) { if (!buffer) {
_kfifo_init(fifo, 0, 0); _kfifo_init(fifo, NULL, 0);
return -ENOMEM; return -ENOMEM;
} }
......
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