Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932493AbWBHKlk (ORCPT ); Wed, 8 Feb 2006 05:41:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932482AbWBHKlj (ORCPT ); Wed, 8 Feb 2006 05:41:39 -0500 Received: from ns.miraclelinux.com ([219.118.163.66]:10351 "EHLO mail01.miraclelinux.com") by vger.kernel.org with ESMTP id S932486AbWBHKli (ORCPT ); Wed, 8 Feb 2006 05:41:38 -0500 Date: Wed, 8 Feb 2006 19:41:21 +0900 To: Roman Zippel Cc: linux-kernel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , dev-etrax@axis.com, David Howells , Yoshinori Sato , Linus Torvalds , linux-ia64@vger.kernel.org, Hirokazu Takata , linux-m68k@vger.kernel.org, linux-mips@linux-mips.org, parisc-linux@parisc-linux.org, linuxsh-dev@lists.sourceforge.net, linuxsh-shmedia-dev@lists.sourceforge.net, sparclinux@vger.kernel.org, ultralinux@vger.kernel.org, Miles Bader , Andi Kleen , Chris Zankel Subject: Re: [patch 15/44] generic ext2_{set,clear,test,find_first_zero,find_next_zero}_bit() Message-ID: <20060208104121.GB27490@miraclelinux.com> References: <20060201090224.536581000@localhost.localdomain> <20060201090326.139510000@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i From: mita@miraclelinux.com (Akinobu Mita) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 865 Lines: 28 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/