kfifo: Don't use integer as NULL pointer
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Wed, 27 Jan 2010 14:09:38 +0000 (17:09 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Feb 2010 23:11:08 +0000 (15:11 -0800)
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>
Acked-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/kfifo.h
kernel/kfifo.c

index 6f6c5f300af6f9bb1485c59960832eca7d8d0983..bc0fc795bd3536c90feb50b0ce4226c6461447e5 100644 (file)
@@ -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;
 }
 
 /**
index 559fb5582b602343def45aeeada25d1d1550dfa1..35edbe22e9a955a1a69cdad290f4861dd76c33e1 100644 (file)
@@ -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;
        }