arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)
authorAnshuman Khandual <anshuman.khandual@arm.com>
Fri, 18 Nov 2022 05:31:02 +0000 (11:01 +0530)
committerWill Deacon <will@kernel.org>
Fri, 18 Nov 2022 14:10:41 +0000 (14:10 +0000)
commit9ed2b4616d4e846ece2a04cb5007ce1d1bd9e3f3
treee6d48c1f9232f3774ba2de9a4d8352b0a9cf1f99
parentd8c1d798a2e5091128c391c6dadcc9be334af3f5
arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)

__create_pgd_mapping_locked() expects a page allocator used while mapping a
virtual range. This page allocator function propagates down the call chain,
while building intermediate levels in the page table. Passed page allocator
is a necessary ingredient required to build the page table but its presence
can be asserted just once in the very beginning rather than in all the down
stream functions. This consolidates BUG_ON(!pgtable_alloc) checks just in a
single place i.e __create_pgd_mapping_locked().

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20221118053102.500216-1-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/mmu.c