xfs
[Top] [All Lists]

Re: [PATCH] fix sparse warning in kmem_shake_allow

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH] fix sparse warning in kmem_shake_allow
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sat, 14 Jul 2007 11:39:16 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20070714160604.GB7768@lst.de>
References: <20070714160604.GB7768@lst.de>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)
Christoph Hellwig wrote:
> We can't returned a masked result of a __bitwise type.  Compare it to
> 0 first to keep the behaviour without the warning.
> 

I wonder if this warrants a comment about sparse to keep it
from disappearing again later...

-Eric

> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/kmem.h
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/kmem.h        2007-07-14 
> 16:00:28.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/kmem.h     2007-07-14 16:00:38.000000000 
> +0200
> @@ -103,7 +103,7 @@ extern void *kmem_zone_zalloc(kmem_zone_
>  static inline int
>  kmem_shake_allow(gfp_t gfp_mask)
>  {
> -     return (gfp_mask & __GFP_WAIT);
> +     return (gfp_mask & __GFP_WAIT) != 0;
>  }
>  
>  #endif /* __XFS_SUPPORT_KMEM_H__ */
> 
> 


<Prev in Thread] Current Thread [Next in Thread>