From: Scott Wood Date: Wed, 9 Sep 2015 14:04:38 -0500 Subject: [U-Boot] [PATCH v5] bitops: introduce BIT() definition In-Reply-To: <20150909182540.25235380DF2@gemini.denx.de> References: <1440176519-30102-2-git-send-email-hs@denx.de> <1441626234-16364-1-git-send-email-andreas.devel@googlemail.com> <20150909182540.25235380DF2@gemini.denx.de> Message-ID: <1441825478.29081.33.camel@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2015-09-09 at 20:25 +0200, Wolfgang Denk wrote: > Dear Andreas, > > In message <1441626234-16364-1-git-send-email-andreas.devel@googlemail.com> > you wrote: > ... > > --- a/include/linux/bitops.h > > +++ b/include/linux/bitops.h > > @@ -3,6 +3,8 @@ > > > > #include > > > > +#define BIT(nr) (1UL << (nr)) > > What happens when someone decides to use this on a 64 bit register? > > Also, this definition is inherently wrong for Power Architecture (TM) > systems, where bit 0 is the most significant bit. It's not "inherently wrong" to number bits from LSB on such systems -- it just doesn't match the unusual convention found in PPC documentation and the rotate instructions. In any case, this would be part of the Linux driver compatibility layer rather than the placement in common.h that you previously objected to. -Scott