All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Nicolas Schier <nicolas@fjasle.eu>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH v2 07/10] kbuild: get rid of duplication in the first line of *.mod files
Date: Wed, 6 Apr 2022 23:49:15 +0900	[thread overview]
Message-ID: <CAK7LNASvibpEkFGJQ5MZS6O9rLpOn+RakbwKqOJwO_MqDOzbjA@mail.gmail.com> (raw)
In-Reply-To: <CAK7LNATUZesT6JsyrQu-ryU+PahwSwX3UVdxnJhyYDetnR_s1A@mail.gmail.com>

On Wed, Apr 6, 2022 at 2:28 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Wed, Apr 6, 2022 at 5:16 AM Nicolas Schier <nicolas@fjasle.eu> wrote:
> >
> > On Tue, Apr 05, 2022 at 08:33:55PM +0900 Masahiro Yamada wrote:
> > > The first line of *.mod lists the member objects of the module.
> > > This list may contain duplication if the same object is added multiple
> > > times, like this:
> > >
> > >   obj-m := foo.o
> > >   foo-$(CONFIG_FOO1_X) += foo1.o
> > >   foo-$(CONFIG_FOO1_Y) += foo1.o
> > >   foo-$(CONFIG_FOO2_X) += foo2.o
> > >   foo-$(CONFIG_FOO2_Y) += foo2.o
> > >
> > > This is probably not a big deal. As far as I know, the only small
> > > problem is scripts/mod/sumversion.c parses the same file over again.
> > > This can be avoided by adding $(sort ...). It has a side-effect that
> > > sorts the objects alphabetically, but it is not a big deal, either.
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > > Changes in v2:
> > >   - new
> > >
> > >  scripts/Makefile.build | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> > > index 3ef2373f0a57..63625877aeae 100644
> > > --- a/scripts/Makefile.build
> > > +++ b/scripts/Makefile.build
> > > @@ -307,8 +307,10 @@ $(obj)/%.prelink.o: $(obj)/%.o FORCE
> > >       $(call if_changed,cc_prelink_modules)
> > >  endif
> > >
> > > +multi-m-prereqs = $(sort $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)))
> > > +
> > >  cmd_mod = { \
> > > -     echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \
> > > +     echo $(if $(multi-m-prereqs), $(multi-m-prereqs), $(@:.mod=.o)); \
> >
> > I'd rather expected to see $(or) here, too, as in commit 5c8166419acf ("kbuild:
> > replace $(if A,A,B) with $(or A,B)").
>
> Ah, good catch.
>
> I fixed it up locally.


I changed my mind.
I will throw away 07 and 08.

I will send different patches later.




>
> Thanks for the review.


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2022-04-06 17:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 11:33 [PATCH v2 00/10] kbuild: misc cleanups Masahiro Yamada
2022-04-05 11:33 ` [PATCH v2 01/10] kbuild: factor out genksyms command from cmd_gensymtypes_{c,S} Masahiro Yamada
2022-04-05 16:16   ` Nick Desaulniers
2022-04-05 20:00   ` Nicolas Schier
2022-04-05 11:33 ` [PATCH v2 02/10] kbuild: do not remove empty *.symtypes explicitly Masahiro Yamada
2022-04-05 16:18   ` Nick Desaulniers
2022-04-05 20:01   ` Nicolas Schier
2022-04-05 11:33 ` [PATCH v2 03/10] modpost: remove useless export_from_sec() Masahiro Yamada
2022-04-05 11:33 ` [PATCH v2 04/10] modpost: move export_from_secname() call to more relevant place Masahiro Yamada
2022-04-05 11:33 ` [PATCH v2 05/10] modpost: remove redundant initializes for static variables Masahiro Yamada
2022-04-05 16:21   ` Nick Desaulniers
2022-04-05 11:33 ` [PATCH v2 06/10] modpost: remove annoying namespace_from_kstrtabns() Masahiro Yamada
2022-04-05 16:26   ` Nick Desaulniers
2022-04-05 11:33 ` [PATCH v2 07/10] kbuild: get rid of duplication in the first line of *.mod files Masahiro Yamada
2022-04-05 20:16   ` Nicolas Schier
2022-04-06  5:28     ` Masahiro Yamada
2022-04-06 14:49       ` Masahiro Yamada [this message]
2022-04-05 11:33 ` [PATCH v2 08/10] kbuild: split the second line of *.mod into *.usyms Masahiro Yamada
2022-04-05 20:30   ` Nicolas Schier
2022-04-05 11:33 ` [PATCH v2 09/10] kbuild: refactor cmd_modversions_c Masahiro Yamada
2022-04-05 16:42   ` Nick Desaulniers
2022-04-05 11:33 ` [PATCH v2 10/10] kbuild: refactor cmd_modversions_S Masahiro Yamada
2022-04-05 16:47   ` Nick Desaulniers
2022-04-05 14:02 [PATCH v2 00/10] kbuild: misc cleanups Masahiro Yamada
2022-04-05 14:02 ` [PATCH v2 07/10] kbuild: get rid of duplication in the first line of *.mod files Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNASvibpEkFGJQ5MZS6O9rLpOn+RakbwKqOJwO_MqDOzbjA@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.