[PATCH RFC v3 12/21] mm/pgtable: redefine PGTABLE_LEVEL enum with ascend order from PGD

David Hildenbrand (Arm) david at kernel.org
Thu Sep 10 04:05:18 PDT 2026


On 9/2/26 13:56, Yeoreum Yun wrote:
> The PGTABLE_LEVEL enum values appear to be ordered in the opposite direction
> from their intended usage.
> 
> Intuitively, higher page table levels should have smaller enum values,
> but PTE is currently assigned 0.
> 
> For consistency and cleanup, reverse the enum value ordering.
> 
> Since there is no current user relies on these numbers to be ascending from
> PTE->PGD, so it can be changed to be ascending from PGD->PTE, in the
> direction of the page table walk.
> 
> Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
> ---

Reviewed-by: David Hildenbrand (Arm) <david at kernel.org>

-- 
Cheers,

David



More information about the linux-riscv mailing list