From a23a0671935568862ca23bd638fd9418e3cd4bc8 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 17 May 2018 13:58:11 -0700 Subject: ARM: mmu: Make use of IS_ALIGNED in arm_mmu_remap_sdram() Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- arch/arm/cpu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/cpu/mmu.c') diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 9472013ca1..c70e9e782c 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -241,7 +241,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank) * We replace each 1MiB section in this range with second level page * tables, therefore we must have 1Mib aligment here. */ - if ((phys & (SZ_1M - 1)) || (bank->size & (SZ_1M - 1))) + if (!IS_ALIGNED(phys, SZ_1M) || !IS_ALIGNED(bank->size, SZ_1M)) return -EINVAL; ptes = xmemalign(PAGE_SIZE, num_ptes * sizeof(u32)); -- cgit v1.2.3