lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 04/44] x86/pkeys: Add additional PKEY helper macros
On 1/27/22 09:54, ira.weiny@intel.com wrote:
> +#define PKR_AD_KEY(pkey) (PKR_AD_BIT << PKR_PKEY_SHIFT(pkey))
> +#define PKR_WD_KEY(pkey) (PKR_WD_BIT << PKR_PKEY_SHIFT(pkey))

I don't _hate_ this, but naming here is wonky for me. PKR_WD_KEY reads
to me as "pkey register write-disable key", as in, please write-disable
this key, or maybe "make a write-disable key".

It's generating a mask, so I'd probably name it:

#define PKR_WD_MASK(pkey) (PKR_WD_BIT << PKR_PKEY_SHIFT(pkey))

Which says, "generate a write-disabled mask for this pkey".

\
 
 \ /
  Last update: 2022-01-28 23:49    [W:0.618 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site