* [PATCH] kbuild: do not sort after reading modules.order
@ 2022-12-11 9:49 Masahiro Yamada
2022-12-13 4:18 ` Nicolas Schier
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-12-11 9:49 UTC (permalink / raw)
To: linux-kbuild
Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor,
Nick Desaulniers, Nicolas Schier
modules.order lists modules in the deterministic order (that is why
"modules order"), and there is no duplication in the list.
$(sort ) is pointless.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Makefile.modfinal | 2 +-
scripts/Makefile.modinst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
index 25bedd83644b..4705d32388f3 100644
--- a/scripts/Makefile.modfinal
+++ b/scripts/Makefile.modfinal
@@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include
include $(srctree)/scripts/Makefile.lib
# find all modules listed in modules.order
-modules := $(sort $(shell cat $(MODORDER)))
+modules := $(shell cat $(MODORDER))
__modfinal: $(modules)
@:
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index a4c987c23750..f4cff42069ad 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -9,7 +9,7 @@ __modinst:
include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
-modules := $(sort $(shell cat $(MODORDER)))
+modules := $(shell cat $(MODORDER))
ifeq ($(KBUILD_EXTMOD),)
dst := $(MODLIB)/kernel
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: do not sort after reading modules.order
2022-12-11 9:49 [PATCH] kbuild: do not sort after reading modules.order Masahiro Yamada
@ 2022-12-13 4:18 ` Nicolas Schier
2022-12-13 6:41 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Schier @ 2022-12-13 4:18 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, linux-kernel, Nathan Chancellor, Nick Desaulniers
[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]
On Sun 11 Dec 2022 18:49:18 GMT, Masahiro Yamada wrote:
> modules.order lists modules in the deterministic order (that is why
> "modules order"), and there is no duplication in the list.
Isn't a subdirectory's modules.order just created by
concatenation of $(obj-m) (w/ respect to mentioned subdirs)?
Thus, "no duplication" seems to be true, as long as there is no obj-m
containing duplicated entries. Do we ensure unique entries in obj-m
only?
Kind regards,
Nicolas
>
> $(sort ) is pointless.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> scripts/Makefile.modfinal | 2 +-
> scripts/Makefile.modinst | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
> index 25bedd83644b..4705d32388f3 100644
> --- a/scripts/Makefile.modfinal
> +++ b/scripts/Makefile.modfinal
> @@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include
> include $(srctree)/scripts/Makefile.lib
>
> # find all modules listed in modules.order
> -modules := $(sort $(shell cat $(MODORDER)))
> +modules := $(shell cat $(MODORDER))
>
> __modfinal: $(modules)
> @:
> diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> index a4c987c23750..f4cff42069ad 100644
> --- a/scripts/Makefile.modinst
> +++ b/scripts/Makefile.modinst
> @@ -9,7 +9,7 @@ __modinst:
> include include/config/auto.conf
> include $(srctree)/scripts/Kbuild.include
>
> -modules := $(sort $(shell cat $(MODORDER)))
> +modules := $(shell cat $(MODORDER))
>
> ifeq ($(KBUILD_EXTMOD),)
> dst := $(MODLIB)/kernel
> --
> 2.34.1
--
epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
-- frykten for herren er opphav til kunnskap --
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: do not sort after reading modules.order
2022-12-13 4:18 ` Nicolas Schier
@ 2022-12-13 6:41 ` Masahiro Yamada
2022-12-13 9:49 ` Nicolas Schier
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-12-13 6:41 UTC (permalink / raw)
To: Nicolas Schier
Cc: linux-kbuild, linux-kernel, Nathan Chancellor, Nick Desaulniers
On Tue, Dec 13, 2022 at 1:18 PM Nicolas Schier <nicolas@fjasle.eu> wrote:
>
> On Sun 11 Dec 2022 18:49:18 GMT, Masahiro Yamada wrote:
> > modules.order lists modules in the deterministic order (that is why
> > "modules order"), and there is no duplication in the list.
>
> Isn't a subdirectory's modules.order just created by
> concatenation of $(obj-m) (w/ respect to mentioned subdirs)?
Not $(obj-m) directly.
The magic is $^, which is a deduplicated list
of prerequisites.
> Thus, "no duplication" seems to be true, as long as there is no obj-m
> containing duplicated entries. Do we ensure unique entries in obj-m
> only?
The entries in modules.order must be unique.
Moreover, the basename of modules must be unique.
scripts/modules-check.sh is a stronger check.
You might be interested in these commits:
d724b578a1f746db6fc1fd5e4cbba554a855dc8d
3a48a91901c516a46a3406ea576798538a8d94d2
>
> Kind regards,
> Nicolas
>
> >
> > $(sort ) is pointless.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> > scripts/Makefile.modfinal | 2 +-
> > scripts/Makefile.modinst | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
> > index 25bedd83644b..4705d32388f3 100644
> > --- a/scripts/Makefile.modfinal
> > +++ b/scripts/Makefile.modfinal
> > @@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include
> > include $(srctree)/scripts/Makefile.lib
> >
> > # find all modules listed in modules.order
> > -modules := $(sort $(shell cat $(MODORDER)))
> > +modules := $(shell cat $(MODORDER))
> >
> > __modfinal: $(modules)
> > @:
> > diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> > index a4c987c23750..f4cff42069ad 100644
> > --- a/scripts/Makefile.modinst
> > +++ b/scripts/Makefile.modinst
> > @@ -9,7 +9,7 @@ __modinst:
> > include include/config/auto.conf
> > include $(srctree)/scripts/Kbuild.include
> >
> > -modules := $(sort $(shell cat $(MODORDER)))
> > +modules := $(shell cat $(MODORDER))
> >
> > ifeq ($(KBUILD_EXTMOD),)
> > dst := $(MODLIB)/kernel
> > --
> > 2.34.1
>
> --
> epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc
> ↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
> -- frykten for herren er opphav til kunnskap --
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: do not sort after reading modules.order
2022-12-13 6:41 ` Masahiro Yamada
@ 2022-12-13 9:49 ` Nicolas Schier
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Schier @ 2022-12-13 9:49 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, linux-kernel, Nathan Chancellor, Nick Desaulniers
On Tue, Dec 13, 2022 at 03:41:36PM +0900 Masahiro Yamada wrote:
> On Tue, Dec 13, 2022 at 1:18 PM Nicolas Schier <nicolas@fjasle.eu> wrote:
> >
> > On Sun 11 Dec 2022 18:49:18 GMT, Masahiro Yamada wrote:
> > > modules.order lists modules in the deterministic order (that is why
> > > "modules order"), and there is no duplication in the list.
> >
> > Isn't a subdirectory's modules.order just created by
> > concatenation of $(obj-m) (w/ respect to mentioned subdirs)?
>
> Not $(obj-m) directly.
>
> The magic is $^, which is a deduplicated list
> of prerequisites.
>
>
> > Thus, "no duplication" seems to be true, as long as there is no obj-m
> > containing duplicated entries. Do we ensure unique entries in obj-m
> > only?
>
>
> The entries in modules.order must be unique.
> Moreover, the basename of modules must be unique.
>
> scripts/modules-check.sh is a stronger check.
>
>
> You might be interested in these commits:
>
> d724b578a1f746db6fc1fd5e4cbba554a855dc8d
> 3a48a91901c516a46a3406ea576798538a8d94d2
ah, thanks!
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
> > >
> > > $(sort ) is pointless.
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > > scripts/Makefile.modfinal | 2 +-
> > > scripts/Makefile.modinst | 2 +-
> > > 2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
> > > index 25bedd83644b..4705d32388f3 100644
> > > --- a/scripts/Makefile.modfinal
> > > +++ b/scripts/Makefile.modfinal
> > > @@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include
> > > include $(srctree)/scripts/Makefile.lib
> > >
> > > # find all modules listed in modules.order
> > > -modules := $(sort $(shell cat $(MODORDER)))
> > > +modules := $(shell cat $(MODORDER))
> > >
> > > __modfinal: $(modules)
> > > @:
> > > diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> > > index a4c987c23750..f4cff42069ad 100644
> > > --- a/scripts/Makefile.modinst
> > > +++ b/scripts/Makefile.modinst
> > > @@ -9,7 +9,7 @@ __modinst:
> > > include include/config/auto.conf
> > > include $(srctree)/scripts/Kbuild.include
> > >
> > > -modules := $(sort $(shell cat $(MODORDER)))
> > > +modules := $(shell cat $(MODORDER))
> > >
> > > ifeq ($(KBUILD_EXTMOD),)
> > > dst := $(MODLIB)/kernel
> > > --
> > > 2.34.1
> >
> > --
> > epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc
> > ↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
> > -- frykten for herren er opphav til kunnskap --
>
>
>
> --
> Best Regards
> Masahiro Yamada
--
epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
-- frykten for herren er opphav til kunnskap --
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-13 9:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11 9:49 [PATCH] kbuild: do not sort after reading modules.order Masahiro Yamada
2022-12-13 4:18 ` Nicolas Schier
2022-12-13 6:41 ` Masahiro Yamada
2022-12-13 9:49 ` Nicolas Schier
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.