Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37773409rwd; Tue, 11 Jul 2023 20:33:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlGbE6j9UvmERM6gNZysY6e54z/qovy0P+MDtnfPccnggXOAeFPYGQawJd2/pa5rfI31NUMg X-Received: by 2002:a05:6870:969f:b0:1b0:3118:1e83 with SMTP id o31-20020a056870969f00b001b031181e83mr16388925oaq.49.1689132783815; Tue, 11 Jul 2023 20:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689132783; cv=none; d=google.com; s=arc-20160816; b=cvRdfUOGJbyAnBh9lyVkYSFZomyvfCOhWuQAAUGzK70/oF3ag29HckVyEwuM18Uge3 RlO4rvwI7N2N/LH5l8AItyIF65KSLN3+dOqCvUQQTbVq+OhQineDRft5hyJq2/bFn9KC d3FpfHe0b8oSGpli9o5sgnCG3uyzBjqK4AIaTbZVbQjXh1oVHk6pdpc2a7/cb8LgT4J9 V3/ElncLZ0Ny065oadOIvg4FYdjgdrDJ2yHjkZJOKB69HcfuL/2SRvObAReAmqDHmrSV UC+A05IzCi0S4gWrMyquyZ5kKjWygMkwnP7VUU3igr0cVAN0BF3cmLFgCO4qkwOMrTrU EbPg== 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=NBAGQU2ubKyI1+YBwA1SLOrKSa0seSj8mfFvDVfCZBQ=; fh=0EL+iotVhsZFwjEWmZ6zpavmrVrlDb0rJf8YE1ub+kM=; b=Nj8E/lYbktAZ3wjaTl8ljK61f068CZHtKiApeU/HtCjEgofPB2AYqeK3WjoN/6fmLw ZJXPWuJJTvzMP1f9styHrTAr7DaxlolHwMUk5Qb3EQeuuV9B/xJCDTeVD6zb/3n8xKND pNLRs25kmP51YtN+a95nHny4Imluzk+L3E5k6uK4zOYKX584UML94e1VuE9H6cBbMCHc p0oAhYEMpxQoHCtcsvmIoPaNFx+fNdE8CUIhRgPhszmshnGFO/U+t3oVz5RtcVKp3Y4Z 3IT3A8ChxfnEa4odHDBlyWmCxVT9r/Nu53BVtMx/Pccu8ChfkqzVeTFdsCQqYGxHtBYl oapQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l187-20020a6391c4000000b00544c0bf5ffesi2443515pge.606.2023.07.11.20.32.51; Tue, 11 Jul 2023 20:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjGLDQa (ORCPT + 99 others); Tue, 11 Jul 2023 23:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbjGLDQ0 (ORCPT ); Tue, 11 Jul 2023 23:16:26 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 57E6110DD for ; Tue, 11 Jul 2023 20:16:24 -0700 (PDT) Received: from loongson.cn (unknown [10.2.9.158]) by gateway (Coremail) with SMTP id _____8CxLOsGG65kfscDAA--.5572S3; Wed, 12 Jul 2023 11:16:22 +0800 (CST) Received: from kvm-1-158.loongson.cn (unknown [10.2.9.158]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxWM0GG65kA7cpAA--.53483S3; Wed, 12 Jul 2023 11:16:22 +0800 (CST) From: Bibo Mao To: Huacai Chen , Dennis Zhou , Tejun Heo , Christoph Lameter Cc: Andrew Morton , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, WANG Xuerui Subject: [PATCH 1/3] mm/percpu: Remove some local variables in pcpu_populate_pte Date: Wed, 12 Jul 2023 11:16:20 +0800 Message-Id: <20230712031622.1888321-2-maobibo@loongson.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230712031622.1888321-1-maobibo@loongson.cn> References: <20230712031622.1888321-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxWM0GG65kA7cpAA--.53483S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW7uFWrCr1UWw4fXrWUJr13trc_yoW8Xr4Up3 93W3s29r4fJwnrGan3Gas8Wr17Xw4rta4Fk3srXr1rZ3W3ZrnxWr4jyw42ga42yFWfZF1x Jr45Ja9rAan0v3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUx529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAaw2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_ WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwI xGrwCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWU JVW8JwCFI7km07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4 vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IY x2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26c xKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAF wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jr6p9UUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function pcpu_populate_pte there are already variable defined, it can be reused for later use, here remove duplicated local variables. Signed-off-by: Bibo Mao --- mm/percpu.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index 28e07ede46f6..85e3f9b2a61f 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -3189,32 +3189,26 @@ void __init __weak pcpu_populate_pte(unsigned long addr) pmd_t *pmd; if (pgd_none(*pgd)) { - p4d_t *new; - - new = memblock_alloc(P4D_TABLE_SIZE, P4D_TABLE_SIZE); - if (!new) + p4d = memblock_alloc(P4D_TABLE_SIZE, P4D_TABLE_SIZE); + if (!p4d) goto err_alloc; - pgd_populate(&init_mm, pgd, new); + pgd_populate(&init_mm, pgd, p4d); } p4d = p4d_offset(pgd, addr); if (p4d_none(*p4d)) { - pud_t *new; - - new = memblock_alloc(PUD_TABLE_SIZE, PUD_TABLE_SIZE); - if (!new) + pud = memblock_alloc(PUD_TABLE_SIZE, PUD_TABLE_SIZE); + if (!pud) goto err_alloc; - p4d_populate(&init_mm, p4d, new); + p4d_populate(&init_mm, p4d, pud); } pud = pud_offset(p4d, addr); if (pud_none(*pud)) { - pmd_t *new; - - new = memblock_alloc(PMD_TABLE_SIZE, PMD_TABLE_SIZE); - if (!new) + pmd = memblock_alloc(PMD_TABLE_SIZE, PMD_TABLE_SIZE); + if (!pmd) goto err_alloc; - pud_populate(&init_mm, pud, new); + pud_populate(&init_mm, pud, pmd); } pmd = pmd_offset(pud, addr); -- 2.27.0