diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2018-03-07 19:06:45 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-04-04 15:23:09 +1000 |
commit | f2ed480fa4d7f95b190279722690df8d4a396b3e (patch) | |
tree | 74abb74702e3e68cfc46392cc2247d46833d03e8 /arch/powerpc/mm/pkeys.c | |
parent | b9ee31e100e73075431faaf7af2ee0fbfd6e624b (diff) |
powerpc/mm/keys: Update documentation and remove unnecessary check
Adds more code comments. We also remove an unnecessary pkey check
after we check for pkey error in this patch.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pkeys.c')
-rw-r--r-- | arch/powerpc/mm/pkeys.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c index 328737b4d73c..0eafdf01edc7 100644 --- a/arch/powerpc/mm/pkeys.c +++ b/arch/powerpc/mm/pkeys.c @@ -119,18 +119,15 @@ int pkey_initialize(void) #else os_reserved = 0; #endif + initial_allocation_mask = ~0x0; + pkey_amr_uamor_mask = ~0x0ul; + pkey_iamr_mask = ~0x0ul; /* - * Bits are in LE format. NOTE: 1, 0 are reserved. + * key 0, 1 are reserved. * key 0 is the default key, which allows read/write/execute. * key 1 is recommended not to be used. PowerISA(3.0) page 1015, * programming note. */ - initial_allocation_mask = ~0x0; - - /* register mask is in BE format */ - pkey_amr_uamor_mask = ~0x0ul; - pkey_iamr_mask = ~0x0ul; - for (i = 2; i < (pkeys_total - os_reserved); i++) { initial_allocation_mask &= ~(0x1 << i); pkey_amr_uamor_mask &= ~(0x3ul << pkeyshift(i)); |