[PATCH] ext3: Fix sparse -Wbitwise warnings.

Andreas Dilger adilger at clusterfs.com
Tue Feb 15 23:46:37 UTC 2005


On Feb 15, 2005  15:29 -0800, Mitchell Blank Jr wrote:
> Stephen C. Tweedie wrote:
> > If we want to fix this, let's fix the macros: for example, convert
> > EXT3_HAS_COMPAT_FEATURE to be
> > 
> > 	( le32_to_cpu(EXT3_SB(sb)->s_es->s_feature_compat) & (mask) )
> 
> Of course that's less efficient though since "mask" is probably constant..
> so now the endian conversion changed from compile-time to run-time.
> 
> Would something like
> 
>  	( ( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) != 0)
> 
> be enough to satisfy sparse?

Or we could cast "mask" to the appropriate type (I'm not sure what sparse
uses to determine this).

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/             http://members.shaw.ca/golinux/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20050215/d9f24fcf/attachment.sig>


More information about the Ext3-users mailing list