[Patch v2 03/11] ARM: hwcaps: use shifts instead of hardcoded constants

Will Deacon will.deacon at arm.com
Mon Jun 13 10:10:13 EDT 2011


Sergei,

On Mon, Jun 13, 2011 at 02:55:16PM +0100, Sergei Shtylyov wrote:
> Hello.
> 
> On 08-06-2011 16:30, Will Deacon wrote:
> 
> > The HWCAP numbers are defined as constants, each one being a power of 2.
> > This has become slightly unwieldy now that we have reached 32k.
> 
> > This patch changes the HWCAP defines to use (1<<  n) instead of coding
> > the constant directly. The values remain unchanged.
> 
>     Perhaps it's better to use BIT(n) macro instead?

That has the downside of breaking userspace, unless we export linux/bitops.h
and remove the __KERNEL__ guards around the BIT macro.

Will



More information about the linux-arm-kernel mailing list