Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3572393pxk; Mon, 28 Sep 2020 23:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2in6hr9ixY7dWCIMO7jgtNC1F7DggWm2+QME3z9+3SwS/THy30sHm5rio45LHoT1p+HdX X-Received: by 2002:aa7:dad8:: with SMTP id x24mr1700618eds.259.1601362376210; Mon, 28 Sep 2020 23:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601362376; cv=none; d=google.com; s=arc-20160816; b=noXGJkta/87wdOGdWs4eIOarJmmQh5KbnWIB72SPqgUfw8fveISZXb/G85HO+N/Udz ytxlR3p5AFJ9Jp+gpety8s0VGCBC7ZD2//0ZwPFmlgbUauEGxNAIIBLZ/rs8bsX++PcB NeoTHc4cVzgITRpnLm6lWusOnQxdWq32B0WV9qbU+O5IlBAniCtBOV9SSBcxl0J77VaK awOgXYwIOENZvYuFsM+RNDhehv15A7DkxoIaxiTGYt8UDi9cUbyQLbC1BgbHh5JJX9tw of2MCGbXdZH/4ggo9s7h6eK4AbgphNWttCqG9RA7FzTAkC5uFvvJANK5YuRqsfP8W6zf V3aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=KLOXC3nDdE57BNheSm++6okJ0BMV1/DM6fD5FxD4d6Y=; b=Lwvy1o5kGwG0DJN3THP22iRtVqrrxRpW+dhKEu/1DzNjlGpWommtAJ4K2+JBWQ6ks3 0a16UN1HqOiTBwV2BbwRjLBLsd+2Yr9Aalddf3KfLgetBLUe/1wq+tL4ZHPS78ZyqEP6 0iIbnjD9HSXu6tqfT/vLnNoEpSuck/HFRTRPjozr/sWEyhxY5LMS6UuoEGwFoO8p361r Q6W2z9D0ZNtTKTPoXUsELEPfIOYiY0l47PqOqWJiRmpZs6VzzU/Psg1908O2Vdh1KFSZ 7/DBL1IsfB65z4PjSSl0NWeelodqN6DFhtW4BOvG/oRTJ2Ftw7+FxUr1o8DdHV4bchMr 7Kug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t4si2054747ejo.316.2020.09.28.23.52.32; Mon, 28 Sep 2020 23:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727610AbgI2Gsr (ORCPT + 99 others); Tue, 29 Sep 2020 02:48:47 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:39143 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgI2Gsp (ORCPT ); Tue, 29 Sep 2020 02:48:45 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4C0qjJ4XfMz9v2cK; Tue, 29 Sep 2020 08:48:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id GhW2mPq8tg6N; Tue, 29 Sep 2020 08:48:36 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4C0qjJ3fYfz9v2c7; Tue, 29 Sep 2020 08:48:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 95B638B7A0; Tue, 29 Sep 2020 08:48:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id lbcbEIQqdMmQ; Tue, 29 Sep 2020 08:48:37 +0200 (CEST) Received: from po17688vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4A4108B76C; Tue, 29 Sep 2020 08:48:37 +0200 (CEST) Received: by po17688vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2997165E8A; Tue, 29 Sep 2020 06:48:37 +0000 (UTC) Message-Id: <31c4cd093963f22831bf388449056ee045533d3b.1601362098.git.christophe.leroy@csgroup.eu> In-Reply-To: <27951fa6c9a8f80724d1bc81a6117ac32343a55d.1601362098.git.christophe.leroy@csgroup.eu> References: <27951fa6c9a8f80724d1bc81a6117ac32343a55d.1601362098.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH v3 6/8] powerpc: Tidy up a bit after removal of PowerPC 601. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 29 Sep 2020 06:48:37 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The removal of the 601 left some standalone blocks from former if/else. Drop the { } and re-indent. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/btext.c | 11 +++------ arch/powerpc/mm/book3s32/mmu.c | 45 +++++++++++++++------------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c index b609fb39dba8..c22a8e0dbc93 100644 --- a/arch/powerpc/kernel/btext.c +++ b/arch/powerpc/kernel/btext.c @@ -95,13 +95,10 @@ void __init btext_prepare_BAT(void) boot_text_mapped = 0; return; } - { - /* 603, 604, G3, G4, ... */ - lowbits = addr & ~0xFF000000UL; - addr &= 0xFF000000UL; - disp_BAT[0] = vaddr | (BL_16M<<2) | 2; - disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW); - } + lowbits = addr & ~0xFF000000UL; + addr &= 0xFF000000UL; + disp_BAT[0] = vaddr | (BL_16M<<2) | 2; + disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW); logicalDisplayBase = (void *) (vaddr + lowbits); } #endif diff --git a/arch/powerpc/mm/book3s32/mmu.c b/arch/powerpc/mm/book3s32/mmu.c index 771d607f1a3d..741e4fc990c7 100644 --- a/arch/powerpc/mm/book3s32/mmu.c +++ b/arch/powerpc/mm/book3s32/mmu.c @@ -73,16 +73,13 @@ unsigned long p_block_mapped(phys_addr_t pa) static int find_free_bat(void) { int b; + int n = mmu_has_feature(MMU_FTR_USE_HIGH_BATS) ? 8 : 4; - { - int n = mmu_has_feature(MMU_FTR_USE_HIGH_BATS) ? 8 : 4; + for (b = 0; b < n; b++) { + struct ppc_bat *bat = BATS[b]; - for (b = 0; b < n; b++) { - struct ppc_bat *bat = BATS[b]; - - if (!(bat[1].batu & 3)) - return b; - } + if (!(bat[1].batu & 3)) + return b; } return -1; } @@ -280,24 +277,22 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys, flags &= ~_PAGE_COHERENT; bl = (size >> 17) - 1; - { - /* Do DBAT first */ - wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE - | _PAGE_COHERENT | _PAGE_GUARDED); - wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX; - bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ - bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp; - if (flags & _PAGE_USER) - bat[1].batu |= 1; /* Vp = 1 */ - if (flags & _PAGE_GUARDED) { - /* G bit must be zero in IBATs */ - flags &= ~_PAGE_EXEC; - } - if (flags & _PAGE_EXEC) - bat[0] = bat[1]; - else - bat[0].batu = bat[0].batl = 0; + /* Do DBAT first */ + wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE + | _PAGE_COHERENT | _PAGE_GUARDED); + wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX; + bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ + bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp; + if (flags & _PAGE_USER) + bat[1].batu |= 1; /* Vp = 1 */ + if (flags & _PAGE_GUARDED) { + /* G bit must be zero in IBATs */ + flags &= ~_PAGE_EXEC; } + if (flags & _PAGE_EXEC) + bat[0] = bat[1]; + else + bat[0].batu = bat[0].batl = 0; bat_addrs[index].start = virt; bat_addrs[index].limit = virt + ((bl + 1) << 17) - 1; -- 2.25.0