From patchwork Fri Oct 6 14:41:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 149276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp379251vqo; Fri, 6 Oct 2023 07:41:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBNh8C9oRMtWWOaPjFDNpJIYW/OanvaCKF6sIyb8lZpsvRmx2HcUY6OABJ5G7fWGArWyly X-Received: by 2002:a17:902:e88c:b0:1c4:fae:bf4a with SMTP id w12-20020a170902e88c00b001c40faebf4amr10401133plg.16.1696603306536; Fri, 06 Oct 2023 07:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696603306; cv=none; d=google.com; s=arc-20160816; b=J/hZZtfwmHvdXhj4CgV4eT8JnbyATSbyZ64tanPRhYxkFe44V+HVy7eEaxJ6kWHuB1 RPNL1KqVhUzF6tbzM+IqHh9+MXI5glFyQCdobMt9qkdFW7yAs8tYpM7UGFcGjrg4kgyR 8Tz8H2BaoPGWc+KhHZmkVb407Wne8Th91a7/ryzCA8EtT2MHuuZjh35nLDtkzhpEePXW fTpW0NzAnyT3OOl45LS3FbgzpCdcdiYeNRaUyeUjco5QJLGSTNpv3vUxYHLPmzh3I4Q/ RZd0H2aOC+VBLibR2Rt+1CdKmDUhDRTDghmEV7HUJ+MQCFTBmcufBXz2RNmkVm2Q7jwG 3bSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Eo52KUMBLwAVFLxZ7EZM1FWk9iMH/v0KS383vFYrDQ8=; fh=sJfVPp9TpZpqbPKPLxG7q4Z2mBGbVYcKWDRgOiqd4Ug=; b=soU9CErtdLvk39lre8DMIeJDS1qs2GAq5X5miEUrreVwBoXV4jBwUF5NuGSHwJoc8Z kDdpuoZaJqpjJXOdMxqUGEIS1l4CI5GCbwfGyr+LuWitqd/zTogqhrc81/tQjLqVEP35 pdZgIEYK4vpy1EBnBVfTGBcBa6kB7SyGkMQjHjTTn6zDGQAXH+x1IUPjgOSd7BtN26Wi J8NeXuY3dfV4BWYRLBtngtSzNVBanahV+9QvL4qoEgdyuXlFb1c1roWXFv482NyED/4P 2bRNpQ66SARmVHkGJXGBV6b5GVKMa4/ySV7qW/wvU5f/2ATKkvps99ECjOwhxLk9siAV bxlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d10-20020a170903230a00b001c5db1e47c3si4065321plh.553.2023.10.06.07.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 07:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C105181B4AE7; Fri, 6 Oct 2023 07:41:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbjJFOlc (ORCPT + 18 others); Fri, 6 Oct 2023 10:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjJFOlY (ORCPT ); Fri, 6 Oct 2023 10:41:24 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1B2CF for ; Fri, 6 Oct 2023 07:41:21 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5e53:403c:300c:38ca]) by michel.telenet-ops.be with bizsmtp id uehJ2A0030nPCdM06ehJJG; Fri, 06 Oct 2023 16:41:18 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qom10-005X4W-1p; Fri, 06 Oct 2023 16:41:18 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qom10-006v2P-02; Fri, 06 Oct 2023 16:41:18 +0200 From: Geert Uytterhoeven To: linux-m68k@lists.linux-m68k.org Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/5] m68k: sun3: Fix indentation by 5 or 7 spaces Date: Fri, 6 Oct 2023 16:41:11 +0200 Message-Id: <167216dfe9795056b7a69415695772887aca6d80.1696602993.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 07:41:43 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779017508921760404 X-GMAIL-MSGID: 1779017508921760404 Indentation should use TABs, not spaces. Fix whitespace in reindented code while at it. Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/sun3_pgalloc.h | 10 ++-- arch/m68k/include/asm/tlbflush.h | 72 ++++++++++++++-------------- arch/m68k/sun3/mmu_emu.c | 40 ++++++++-------- 3 files changed, 60 insertions(+), 62 deletions(-) diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index ff48573db2c04c74..4a137eecb6fe44bd 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h @@ -41,12 +41,12 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page static inline pgd_t * pgd_alloc(struct mm_struct *mm) { - pgd_t *new_pgd; + pgd_t *new_pgd; - new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); - memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); - memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); - return new_pgd; + new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); + memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); + memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); + return new_pgd; } #endif /* SUN3_PGALLOC_H */ diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index 3ab329a03c76c8d8..6d42e2906887931b 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h @@ -112,53 +112,51 @@ extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM]; sun?) */ static inline void flush_tlb_all(void) { - unsigned long addr; - unsigned char ctx, oldctx; - - oldctx = sun3_get_context(); - for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { - for(ctx = 0; ctx < 8; ctx++) { - sun3_put_context(ctx); - sun3_put_segmap(addr, SUN3_INVALID_PMEG); - } - } - - sun3_put_context(oldctx); - /* erase all of the userspace pmeg maps, we've clobbered them - all anyway */ - for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) { - if(pmeg_alloc[addr] == 1) { - pmeg_alloc[addr] = 0; - pmeg_ctx[addr] = 0; - pmeg_vaddr[addr] = 0; - } - } + unsigned long addr; + unsigned char ctx, oldctx; + oldctx = sun3_get_context(); + for (addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { + for (ctx = 0; ctx < 8; ctx++) { + sun3_put_context(ctx); + sun3_put_segmap(addr, SUN3_INVALID_PMEG); + } + } + + sun3_put_context(oldctx); + /* erase all of the userspace pmeg maps, we've clobbered them + all anyway */ + for (addr = 0; addr < SUN3_INVALID_PMEG; addr++) { + if (pmeg_alloc[addr] == 1) { + pmeg_alloc[addr] = 0; + pmeg_ctx[addr] = 0; + pmeg_vaddr[addr] = 0; + } + } } /* Clear user TLB entries within the context named in mm */ static inline void flush_tlb_mm (struct mm_struct *mm) { - unsigned char oldctx; - unsigned char seg; - unsigned long i; - - oldctx = sun3_get_context(); - sun3_put_context(mm->context); + unsigned char oldctx; + unsigned char seg; + unsigned long i; - for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { - seg = sun3_get_segmap(i); - if(seg == SUN3_INVALID_PMEG) - continue; + oldctx = sun3_get_context(); + sun3_put_context(mm->context); - sun3_put_segmap(i, SUN3_INVALID_PMEG); - pmeg_alloc[seg] = 0; - pmeg_ctx[seg] = 0; - pmeg_vaddr[seg] = 0; - } + for (i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { + seg = sun3_get_segmap(i); + if (seg == SUN3_INVALID_PMEG) + continue; - sun3_put_context(oldctx); + sun3_put_segmap(i, SUN3_INVALID_PMEG); + pmeg_alloc[seg] = 0; + pmeg_ctx[seg] = 0; + pmeg_vaddr[seg] = 0; + } + sun3_put_context(oldctx); } /* Flush a single TLB page. In this case, we're limited to flushing a diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index e5a92da43d1978df..119bd32efcfbc9d0 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -207,32 +207,32 @@ void __init mmu_emu_init(unsigned long bootmem_end) context for when they're cleared */ void clear_context(unsigned long context) { - unsigned char oldctx; - unsigned long i; + unsigned char oldctx; + unsigned long i; - if(context) { - if(!ctx_alloc[context]) - panic("%s: context not allocated\n", __func__); + if (context) { + if (!ctx_alloc[context]) + panic("%s: context not allocated\n", __func__); - ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; - ctx_alloc[context] = (struct mm_struct *)0; - ctx_avail++; - } + ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; + ctx_alloc[context] = (struct mm_struct *)0; + ctx_avail++; + } - oldctx = sun3_get_context(); + oldctx = sun3_get_context(); - sun3_put_context(context); + sun3_put_context(context); - for(i = 0; i < SUN3_INVALID_PMEG; i++) { - if((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { - sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); - pmeg_ctx[i] = 0; - pmeg_alloc[i] = 0; - pmeg_vaddr[i] = 0; - } - } + for (i = 0; i < SUN3_INVALID_PMEG; i++) { + if ((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { + sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); + pmeg_ctx[i] = 0; + pmeg_alloc[i] = 0; + pmeg_vaddr[i] = 0; + } + } - sun3_put_context(oldctx); + sun3_put_context(oldctx); } /* gets an empty context. if full, kills the next context listed to