From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKxm4-0002Dg-5O for barebox@lists.infradead.org; Tue, 22 May 2018 03:15:45 +0000 Received: by mail-pf0-x244.google.com with SMTP id c10-v6so8024572pfi.12 for ; Mon, 21 May 2018 20:15:33 -0700 (PDT) From: Andrey Smirnov Date: Mon, 21 May 2018 20:14:44 -0700 Message-Id: <20180522031510.25505-4-andrew.smirnov@gmail.com> In-Reply-To: <20180522031510.25505-1-andrew.smirnov@gmail.com> References: <20180522031510.25505-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v4 03/29] ARM: mmu: Use ALIGN and ALIGN_DOWN in map_cachable() To: barebox@lists.infradead.org Cc: Andrey Smirnov Signed-off-by: Andrey Smirnov --- arch/arm/cpu/mmu-early.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c index 70cb5fe31..fc14d5cac 100644 --- a/arch/arm/cpu/mmu-early.c +++ b/arch/arm/cpu/mmu-early.c @@ -23,8 +23,8 @@ static void create_sections(unsigned long addr, int size_m, unsigned int flags) static void map_cachable(unsigned long start, unsigned long size) { - start &= ~(SZ_1M - 1); - size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1); + start = ALIGN_DOWN(start, SZ_1M); + size = ALIGN(size, SZ_1M); create_sections(start, size >> 20, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB); -- 2.17.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox