diff options
| author | Nanyong Sun <sunnanyong@huawei.com> | 2021-04-30 16:28:47 +0800 |
|---|---|---|
| committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-05-22 10:19:29 -0700 |
| commit | f5397c3ee0a3e2ca0a6d66d079ffcd5386b45b81 (patch) | |
| tree | 8372806f05bfd2b3cca7a2eef002302e0c3f04c8 /arch/riscv/include/asm/pgtable-64.h | |
| parent | 6efb943b8616ec53a5e444193dccf1af9ad627b5 (diff) | |
riscv: mm: add _PAGE_LEAF macro
In riscv, a page table entry is leaf when any bit of read, write,
or execute bit is set. So add a macro:_PAGE_LEAF instead of
(_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC), which is frequently used
to determine if it is a leaf page. This make code easier to read,
without any functional change.
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/pgtable-64.h')
| -rw-r--r-- | arch/riscv/include/asm/pgtable-64.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/riscv/include/asm/pgtable-64.h b/arch/riscv/include/asm/pgtable-64.h index f3b0da64c6c8..e3b7c5dd6a80 100644 --- a/arch/riscv/include/asm/pgtable-64.h +++ b/arch/riscv/include/asm/pgtable-64.h @@ -46,8 +46,7 @@ static inline int pud_bad(pud_t pud) #define pud_leaf pud_leaf static inline int pud_leaf(pud_t pud) { - return pud_present(pud) && - (pud_val(pud) & (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC)); + return pud_present(pud) && (pud_val(pud) & _PAGE_LEAF); } static inline void set_pud(pud_t *pudp, pud_t pud) |
