Patchwork [04/11] jbd2: use NULL instead of 0 when pointer is needed

login
register
mail settings
Submitter Bill Pemberton
Date April 30, 2010, 1:34 p.m.
Message ID <1272634478-4127-5-git-send-email-wfp5p@virginia.edu>
Download mbox | patch
Permalink /patch/51374/
State New
Headers show

Comments

Bill Pemberton - April 30, 2010, 1:34 p.m.
Fixes sparse warning:

fs/jbd2/journal.c:1892:9: warning: Using plain integer as NULL pointer

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
CC: linux-ext4@vger.kernel.org
---
 fs/jbd2/journal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jiri Kosina - May 11, 2010, 8:05 a.m.
On Fri, 30 Apr 2010, Bill Pemberton wrote:

> Fixes sparse warning:
> 
> fs/jbd2/journal.c:1892:9: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> CC: linux-ext4@vger.kernel.org
> ---
>  fs/jbd2/journal.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index c03d4dc..bc2ff59 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -1889,7 +1889,7 @@ static struct kmem_cache *get_slab(size_t size)
>  	BUG_ON(i >= JBD2_MAX_SLABS);
>  	if (unlikely(i < 0))
>  		i = 0;
> -	BUG_ON(jbd2_slab[i] == 0);
> +	BUG_ON(jbd2_slab[i] == NULL);
>  	return jbd2_slab[i];
>  }

This doesn't seem to be picked up as per today's linux-next. I have 
applied the patch to my queue.

Patch

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index c03d4dc..bc2ff59 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1889,7 +1889,7 @@  static struct kmem_cache *get_slab(size_t size)
 	BUG_ON(i >= JBD2_MAX_SLABS);
 	if (unlikely(i < 0))
 		i = 0;
-	BUG_ON(jbd2_slab[i] == 0);
+	BUG_ON(jbd2_slab[i] == NULL);
 	return jbd2_slab[i];
 }