Re: [patch 15/44] generic ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()

[email protected] (Akinobu Mita)
Newsgroups gmane.linux.ports.ia64,gmane.linux.kernel,gmane.linux.ports.hppa,gmane.linux.ports.sh.devel,gmane.linux.ports.sparc,gmane.linux.ports.ultrapenguin
Message-ID <[email protected]>
On Wed, Feb 01, 2006 at 12:27:38PM +0100, Roman Zippel wrote:

> For the inline version I would prefer this version:
> 
> {
> 	const unsigned char *tmp = (const unsigned char *)addr;
> 	return (tmp[nr >> 3] & (unsigned char)(1 << (nr & 7))) != 0;
> }
> 
> Although this would be a good alternative as well:
> 
> {
> 	return (addr[nr >> 5] & (1 << ((nr ^ 24) & 31))) != 0;
> }

Thanks, maybe I could use BITOP_LE_SWIZZLE similar to other *_le_bit().

#define BITOP_LE_SWIZZLE       ((BITS_PER_LONG-1) & ~0x7)
 :
#define generic_test_le_bit(nr, addr) test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
 :
#endif /* __BIG_ENDIAN */

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.