Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp505697rwb; Thu, 27 Jul 2023 16:49:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEOPPsZQFyBIEPeYo8gmxXCjQX/+wjz9vM3OVG+ud97UT3asTR1sDcADcxOE7HmgCLVadW0 X-Received: by 2002:a17:90b:100d:b0:268:6670:46df with SMTP id gm13-20020a17090b100d00b00268667046dfmr41362pjb.27.1690501784541; Thu, 27 Jul 2023 16:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690501784; cv=none; d=google.com; s=arc-20160816; b=MbNYSqXDv757L+cXsyIgwMYWebTNdS3skVlNOYl2Qk3vdq0nUWpl5gt0IBD3fzvkuB iHYIS/wGzUubV+WgveS4wZpuTv0/JsAoSxSRqe3ngU/P2R5R66lWoE7S0A4n63bMNZZB MBivwuVKHWqQf/6PeQCz81au5c+OPFO+OZDQ+MhPNUi8zW6It9IP6ikY7Sl6Sv5BylWO 1FnWg4No4jqhN+WaDZRsibTj1cgYq7PxcvMJ10Z5BZIWggGNT6/LW51uAsQPRRKmmCO9 /6Y+1T5npzx9XnZqSq+BZEm859WWveJMMPLiVHQYcuqU8x4YoDBWzQFbllzvKAvAiP54 OdGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=UBYOBoJLYiNWyPBZ8JtjEPNaBvs8n9DfL50KMt5h7Ws=; fh=aXX3l10e4Cho9viQ8HtXrug51g/UBeWaPaTdHAF2RIY=; b=XJUAH5qfrbKzAQbfuUhMFEqviKMtqVOVe47QUb3MF19Hz+plY4K7uF8re2cxfMKUJ4 fThMwNhiGtdvWrcbA9I+Fwj3w2zZ5smMjz7TBWN48Q32wYvdc2K8lesw2lUQYVi7Jqr/ Gq+sZwjPIwCcjjwZKUp4cw7aO4/amOS6r2guvrVn0pmCdiOe7Qh71Hy35Um158aHbv4w d2kJP6Ci76EV/E7E2bMDUPo6dNXCqrIPtqC2QGhWMIcbm/2pDzkKoErpza/TwMIzUJfY fcBoTFd9893kebGPPP/f4Y4HL/6P6HjdgFoNuF8waP3ziiB5C12kqt0WLGnYUIpwL03C +SLA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a17090a34c300b0026825823da0si2063306pjf.59.2023.07.27.16.49.22; Thu, 27 Jul 2023 16:49:44 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbjG0XIP (ORCPT + 99 others); Thu, 27 Jul 2023 19:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjG0XIO (ORCPT ); Thu, 27 Jul 2023 19:08:14 -0400 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51CAC13D for ; Thu, 27 Jul 2023 16:08:13 -0700 (PDT) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-55fcc15e109so859538a12.3 for ; Thu, 27 Jul 2023 16:08:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690499293; x=1691104093; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UBYOBoJLYiNWyPBZ8JtjEPNaBvs8n9DfL50KMt5h7Ws=; b=JTCMpVG2JLtBJ2PJlkB0uJJfdraZWPgYfQaemem2ASYYMJ0om7GOwArZu645thBTQP XibjETXWbWklyjkABoAZAl+bSde67lwHUAzD/Lf1QedIy/wT7g31EAXGPRgIy7JA/M2K SUdl6Y1nJj7wZQotOT9m3SyTbe8+wd5Paf4vR163Tcq1bU90eBydoSqfwygz3x8Y9TDy 0vdndN8MKV4FN5Z/Ldz7o99B+mDRZuY34uTsHtHk9pLfph/c6FQN+UKq4VAooIkyq8V9 A0M0nl4Tku401D9SDQMPCg0pwoYn6uQzluVglVTEowVEfUEVuR3VDxIXxPLHFDD6zWO8 k6nw== X-Gm-Message-State: ABy/qLZsn3fs1DzJW4xeSa6GS7+eHtYkH2g3ZMlw2kjmlLBNjKC4ffs9 ipVKWwdfkJpvwR8py8bR9w0XLBNGIPI4Jg== X-Received: by 2002:a17:90a:bb12:b0:267:faba:705 with SMTP id u18-20020a17090abb1200b00267faba0705mr8961pjr.10.1690499292643; Thu, 27 Jul 2023 16:08:12 -0700 (PDT) Received: from snowbird ([199.73.127.3]) by smtp.gmail.com with ESMTPSA id m8-20020a17090a4d8800b0026822cb85casm1631801pjh.18.2023.07.27.16.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 16:08:12 -0700 (PDT) Date: Thu, 27 Jul 2023 16:08:07 -0700 From: Dennis Zhou To: Bibo Mao Cc: Huacai Chen , Tejun Heo , Christoph Lameter , Andrew Morton , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, WANG Xuerui Subject: Re: [PATCH 1/3] mm/percpu: Remove some local variables in pcpu_populate_pte Message-ID: References: <20230712031622.1888321-1-maobibo@loongson.cn> <20230712031622.1888321-2-maobibo@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712031622.1888321-2-maobibo@loongson.cn> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, On Wed, Jul 12, 2023 at 11:16:20AM +0800, Bibo Mao wrote: > 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 > I've pulled this, but the other 2 are part of loongarch and should be reviewed and pulled by those maintainers. Thanks, Dennis