Subject: Re: [RFC PATCH 7/9] powerpc/mm/book3s-64: Shuffle read, write, execute and user bits in PTE

From: Michael Ellerman <[email-masked]>
Date: Mon, 22 Feb 2016 11:27:36 +1100

On Mon, 2016-02-22 at 09:36 +1100, Paul Mackerras wrote:
> On Sun, Feb 21, 2016 at 01:00:54PM +0530, Aneesh Kumar K.V wrote:
> > Paul Mackerras <[email-masked]> writes:
> >
> > Also can you use constants like
> > #define _PAGE_USER PPC_BIT(60)
>
> I'd really rather not - that is harder for the casual reader to parse,
> because they then have to go off and find out what exactly PPC_BIT
> does.  The only time that using PPC_BIT would help is when checking
> that the bit definitions match the Power ISA, and that's presumably
> done by intelligent people that can handle backwards bit numbering in
> their heads. :)

Yep agree 100%.

Using PPC_BIT() means every time someone sees that defintion they need to think
about what the conversion is and whether it's right, ie. for the entire future
history of this code.

On the other hand not using PPC_BIT() means the person who writes the
definition needs to think about it and do the correct conversion, but only
once.

cheers