From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gk1KK-00042R-FU for barebox@lists.infradead.org; Thu, 17 Jan 2019 06:39:03 +0000 Received: by mail-pg1-x542.google.com with SMTP id z11so3998733pgu.0 for ; Wed, 16 Jan 2019 22:38:56 -0800 (PST) From: Andrey Smirnov Date: Wed, 16 Jan 2019 22:38:33 -0800 Message-Id: <20190117063840.13674-6-andrew.smirnov@gmail.com> In-Reply-To: <20190117063840.13674-1-andrew.smirnov@gmail.com> References: <20190117063840.13674-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 05/12] ARM64: mmu: Merge create_sections() and map_region() together To: barebox@lists.infradead.org Cc: Andrey Smirnov Since map_region() is never called without being followed by tlb_invalidate(), merge it with create_sections() to simplify the code. Signed-off-by: Andrey Smirnov --- arch/arm/cpu/mmu_64.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c index d7c2542d1..ad94ff14d 100644 --- a/arch/arm/cpu/mmu_64.c +++ b/arch/arm/cpu/mmu_64.c @@ -119,7 +119,8 @@ static void split_block(uint64_t *pte, int level) set_table(pte, new_table); } -static void map_region(uint64_t virt, uint64_t phys, uint64_t size, uint64_t attr) +static void create_sections(uint64_t virt, uint64_t phys, uint64_t size, + uint64_t attr) { uint64_t block_size; uint64_t block_shift; @@ -162,11 +163,7 @@ static void map_region(uint64_t virt, uint64_t phys, uint64_t size, uint64_t att } } -} -static void create_sections(uint64_t virt, uint64_t phys, uint64_t size, uint64_t flags) -{ - map_region(virt, phys, size, flags); tlb_invalidate(); } @@ -183,9 +180,8 @@ int arch_remap_range(void *_start, size_t size, unsigned flags) return -EINVAL; } - map_region((uint64_t)_start, (uint64_t)_start, (uint64_t)size, flags); - tlb_invalidate(); - + create_sections((uint64_t)_start, (uint64_t)_start, (uint64_t)size, + flags); return 0; } -- 2.20.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox