Re: [PATCH V8 11/44] mm/pkeys: Define static PKS key array and default values

Ira Weiny
2022-02-04T23:54:20Z

On Fri, Jan 28, 2022 at 04:02:05PM -0800, Dave Hansen wrote:
> On 1/27/22 09:54, ira.weiny@intel.com wrote:
> > +#define PKS_INIT_VALUE (PKR_RW_KEY(PKS_KEY_DEFAULT) | \
> > + PKR_AD_KEY(1) | \
> > + PKR_AD_KEY(2) | PKR_AD_KEY(3) | \
> > + PKR_AD_KEY(4) | PKR_AD_KEY(5) | \
> > + PKR_AD_KEY(6) | PKR_AD_KEY(7) | \
> > + PKR_AD_KEY(8) | PKR_AD_KEY(9) | \
> > + PKR_AD_KEY(10) | PKR_AD_KEY(11) | \
> > + PKR_AD_KEY(12) | PKR_AD_KEY(13) | \
> > + PKR_AD_KEY(14) | PKR_AD_KEY(15))
>
> Considering how this is going to get used, let's just make this
> one-key-per-line:
>
> #define PKS_INIT_VALUE (PKR_RW_KEY(PKS_KEY_DEFAULT) | \
> PKR_AD_KEY(1) | \
> PKR_AD_KEY(2) | \
> PKR_AD_KEY(3) | \
> ...

Good idea, done.
Ira