Skip to content

Commit

Permalink
kfifo: Don't use integer as NULL pointer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Stefani Seibold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Anton Vorontsov authored and gregkh committed Feb 16, 2010
1 parent 4c743d0 commit 5a5e0f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/kfifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion kernel/kfifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5a5e0f4

Please sign in to comment.