Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3291565pxj; Tue, 1 Jun 2021 01:42:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf6dWnE+UNaC4SglxEmEtHY1tnacHmoHGSyHdl+HBw7Tz5Xs3wzczF2c9Hvqo1P/Dw/Zdn X-Received: by 2002:aa7:c445:: with SMTP id n5mr11502326edr.64.1622536962862; Tue, 01 Jun 2021 01:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622536962; cv=none; d=google.com; s=arc-20160816; b=t1ZhCVj4lFXArcBehy/CKO7PH5GtUa/m12Q8JqGG+O/Btx6+r034wwGLB321lcS52q LJwcTBqMA765fS+Aje83pOWIum1sB46cF+DuPSBnJKorODZt6JA2ucmyaIfe1RMaqMlt DDOr9RcgfqCjKjUmt6HkR/XnfN6596bg2OPsVvTE1QBmBv/rUEyJAchNQxOrl/0AuHlI UPnryHth0QEisLKzX9VKSer0lvoXGTZNW8/HiIq5hmZfOP0GEz0yQSDiYDzfv6s8gfwH 4hLZ+LCJgDPhNE1bHKG3ydnUjpD7N6QXZ5zEOF077/2X8QmoX/uMMuMZJNwWFC1EYTyj Hwxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XYdknBQo193eNCNhduTrPIy+Y/+hGQ3dFnlOg4zBZ6I=; b=T84R10GxEqZuNVS24azKi9w9OzltZTYjvpTMJZFqayZw5Z/HFBSvmDP+VN7L2KM/VU gONFmV+fhDnRG1ujrqgcZxImVLUho3eMHSdBprDLz9jI167lm4rYYnAu5qkLK9DG3lRg kI65SycNYD/958BzDlBZQJL+sFPrGqZsSDEx6llgE63nIDWlzfgoRUeKre3OGmIe48Gb j25clJG2SCaqOULve9DjsUpMfyCVCBhTfZGtDvl01TpECZMLL5h93N6cHNX6L9kRFOht zhA8QlPZYjLSXj8iO9rA6q3/swKdlxh1lrlk/LvNTQMxgTaezQw64rRILvBBwcMQuyZA ScFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dx8s1vD5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si3621782eds.410.2021.06.01.01.42.20; Tue, 01 Jun 2021 01:42:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dx8s1vD5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233287AbhFAIml (ORCPT + 99 others); Tue, 1 Jun 2021 04:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233165AbhFAImk (ORCPT ); Tue, 1 Jun 2021 04:42:40 -0400 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0375CC061574 for ; Tue, 1 Jun 2021 01:41:00 -0700 (PDT) Received: by mail-oo1-xc2d.google.com with SMTP id e27-20020a056820061bb029020da48eed5cso3327344oow.10 for ; Tue, 01 Jun 2021 01:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XYdknBQo193eNCNhduTrPIy+Y/+hGQ3dFnlOg4zBZ6I=; b=dx8s1vD5Cd514KEwrT2NzfZZ0rJW+QulznUM8B/TAOkv+nyGIkniISQpHXU2YPdJX4 Eof6mdP92MI3sjLn4XKfCyeu/vGbuasjuYb0q4hP55hGzDYHxU5MUlDX9CjUjrCJXN/2 7rywZp/Ob/I7IStWwM3m5eOxcGcCInbwnA1PTbtdOaeFH5r2BC0mbZ9z2zPCZpeJzInH wqgO3ozo95P9wtbwFodaPB/YJLxQBdGeWmwp1IbPr3nHKJwtNn/rpzUjQ58bpFAQN5Vo kXJW/c1mGJGSI0seRN+tbXwAfFigr68Op/rAqMQhWgkOukyOhmdsBVkErMOnYOcZZajZ ZOBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XYdknBQo193eNCNhduTrPIy+Y/+hGQ3dFnlOg4zBZ6I=; b=atBwN6Z3ct9M5fwgfbV0ki0FzTZYIkUHlrp6dc2jEtVcyAtvD6WnkCoEsCTPrjDfQE VC8nzoc7Po/plWCmozug/zf2hMDzZuNuonyWzJjBYvJbGgM9rOBBJ1WYUVoihRifT00+ 7p1vZBH7Qcg1q2NqweImDCWAyuTbRbILzjzZKIB15qxAahs2L3kHdaQljj4Aakiqjcov sT4YV2ZcsNNjQvciHK7ASmCBYNLiSr0FGEN/npD7z5rL4zCy8BCy7DKVYUj+fDoUGzLD QQ2jPidD9E3g55UWWy/sflMmRyd2Jhu3vE/fVYuP1P/XpWs2nUM6tHx2+a2lHuo5uKu9 vASg== X-Gm-Message-State: AOAM531nlqQUJ8k9jVKO7pLLHLQE/RZuIsKCkSZJzPl6SI+7L5wFCLzR phna1iTRfjQqH4jleS2J/hSVbmTLVfeUEaf/2Emg7iCZ X-Received: by 2002:a4a:d89a:: with SMTP id b26mr19548775oov.11.1622536859448; Tue, 01 Jun 2021 01:40:59 -0700 (PDT) MIME-Version: 1.0 References: <20210531091908.1738465-1-aisheng.dong@nxp.com> <20210531091908.1738465-7-aisheng.dong@nxp.com> <274fb19f-d14c-bb45-b69a-a7c8b4c1722e@redhat.com> In-Reply-To: <274fb19f-d14c-bb45-b69a-a7c8b4c1722e@redhat.com> From: Dong Aisheng Date: Tue, 1 Jun 2021 16:39:49 +0800 Message-ID: Subject: Re: [PATCH V2 6/6] mm/sparse: remove one duplicated #ifdef CONFIG_SPARSEMEM_EXTREME To: David Hildenbrand Cc: Dong Aisheng , linux-mm@kvack.org, open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 1, 2021 at 4:26 PM David Hildenbrand wrote: > > On 31.05.21 11:19, Dong Aisheng wrote: > > Those two blocks of code contained by #ifdef CONFIG_SPARSEMEM_EXTREME > > condition are right along with each other. Not need using another #ifdef > > condition. > > > > Signed-off-by: Dong Aisheng > > --- > > ChangeLog: > > *new patch > > --- > > mm/sparse.c | 18 ++++++++---------- > > 1 file changed, 8 insertions(+), 10 deletions(-) > > > > diff --git a/mm/sparse.c b/mm/sparse.c > > index 6412010478f7..2905ee9fde10 100644 > > --- a/mm/sparse.c > > +++ b/mm/sparse.c > > @@ -114,16 +114,7 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid) > > > > return 0; > > } > > -#else /* !SPARSEMEM_EXTREME */ > > -static inline int sparse_index_init(unsigned long section_nr, int nid) > > -{ > > - return 0; > > -} > > > > -static inline void sparse_alloc_section_roots(void) {} > > -#endif > > - > > -#ifdef CONFIG_SPARSEMEM_EXTREME > > unsigned long __section_nr(struct mem_section *ms) > > { > > unsigned long root_nr; > > @@ -142,11 +133,18 @@ unsigned long __section_nr(struct mem_section *ms) > > > > return (root_nr * SECTIONS_PER_ROOT) + (ms - root); > > } > > -#else > > +#else /* !SPARSEMEM_EXTREME */ > > +static inline int sparse_index_init(unsigned long section_nr, int nid) > > +{ > > + return 0; > > +} > > + > > unsigned long __section_nr(struct mem_section *ms) > > { > > return (unsigned long)(ms - mem_sections[0]); > > } > > + > > +static inline void sparse_alloc_section_roots(void) {} > > #endif > > Want to tag that one (endif) with /* SPARSEMEM_EXTREME */ as well while > at it? Thanks, i could add it in v3 later with your tag. Regards Aisheng > > Acked-by: David Hildenbrand > > -- > Thanks, > > David / dhildenb >