[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA+hA=RmW38Ot9S3c9kzGTqfHZZcjw_SOT-T0_80nvJM1p-M0Q@mail.gmail.com>
Date: Tue, 1 Jun 2021 16:39:49 +0800
From: Dong Aisheng <dongas86@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: Dong Aisheng <aisheng.dong@....com>, linux-mm@...ck.org,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 6/6] mm/sparse: remove one duplicated #ifdef CONFIG_SPARSEMEM_EXTREME
On Tue, Jun 1, 2021 at 4:26 PM David Hildenbrand <david@...hat.com> 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 <aisheng.dong@....com>
> > ---
> > 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 <david@...hat.com>
>
> --
> Thanks,
>
> David / dhildenb
>
Powered by blists - more mailing lists