linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m)
@ 2018-12-11 12:01 Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 2/4] kbuild: refactor quiet_modtag Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-12-11 12:01 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

All objects in $(obj-m) are included in $(real-obj-m) as well.

It is true composite objects are only contained in $(obj-m),
but [M] is hard-coded in quiet_cmd_link_multi-m.

This line is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 6a6be9f..5a4fd82 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -110,8 +110,6 @@ $(real-obj-m:.o=.i)  : quiet_modtag := [M]
 $(real-obj-m:.o=.s)  : quiet_modtag := [M]
 $(real-obj-m:.o=.lst): quiet_modtag := [M]
 
-$(obj-m)             : quiet_modtag := [M]
-
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c       = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] kbuild: refactor quiet_modtag
  2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
@ 2018-12-11 12:01 ` Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 3/4] kbuild: refactor part-of-module Masahiro Yamada
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-12-11 12:01 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

part-of-module and quiet_modtag are set for the same targets.
Define quiet_modtag based on part-of-module.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5a4fd82..f26ae45 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -98,18 +98,13 @@ modkern_cflags =                                          \
 	$(if $(part-of-module),                           \
 		$(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
 		$(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
-quiet_modtag := $(empty)   $(empty)
+quiet_modtag = $(if $(part-of-module),[M],   )
 
 $(real-obj-m)        : part-of-module := y
 $(real-obj-m:.o=.i)  : part-of-module := y
 $(real-obj-m:.o=.s)  : part-of-module := y
 $(real-obj-m:.o=.lst): part-of-module := y
 
-$(real-obj-m)        : quiet_modtag := [M]
-$(real-obj-m:.o=.i)  : quiet_modtag := [M]
-$(real-obj-m:.o=.s)  : quiet_modtag := [M]
-$(real-obj-m:.o=.lst): quiet_modtag := [M]
-
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c       = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] kbuild: refactor part-of-module
  2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 2/4] kbuild: refactor quiet_modtag Masahiro Yamada
@ 2018-12-11 12:01 ` Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 4/4] kbuild: handle part-of-module correctly for *.ll and *.symtypes Masahiro Yamada
  2018-12-16 15:40 ` [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-12-11 12:01 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

Use $(foreach ...) to make it shorter.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f26ae45..321b5b7 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -94,17 +94,15 @@ endif
 # ---------------------------------------------------------------------------
 
 # Default is built-in, unless we know otherwise
+$(foreach x, i lst o s, $(patsubst %.o,%.$(x),$(real-obj-m))): \
+	part-of-module := y
+
 modkern_cflags =                                          \
 	$(if $(part-of-module),                           \
 		$(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
 		$(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
 quiet_modtag = $(if $(part-of-module),[M],   )
 
-$(real-obj-m)        : part-of-module := y
-$(real-obj-m:.o=.i)  : part-of-module := y
-$(real-obj-m:.o=.s)  : part-of-module := y
-$(real-obj-m:.o=.lst): part-of-module := y
-
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c       = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] kbuild: handle part-of-module correctly for *.ll and *.symtypes
  2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 2/4] kbuild: refactor quiet_modtag Masahiro Yamada
  2018-12-11 12:01 ` [PATCH 3/4] kbuild: refactor part-of-module Masahiro Yamada
@ 2018-12-11 12:01 ` Masahiro Yamada
  2018-12-16 15:40 ` [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-12-11 12:01 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

The single targets *.ll and *.symtypes never treated as a module.
Fix this.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 321b5b7..795fedc 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -94,7 +94,7 @@ endif
 # ---------------------------------------------------------------------------
 
 # Default is built-in, unless we know otherwise
-$(foreach x, i lst o s, $(patsubst %.o,%.$(x),$(real-obj-m))): \
+$(foreach x, i ll lst o s symtypes, $(patsubst %.o,%.$(x),$(real-obj-m))): \
 	part-of-module := y
 
 modkern_cflags =                                          \
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m)
  2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
                   ` (2 preceding siblings ...)
  2018-12-11 12:01 ` [PATCH 4/4] kbuild: handle part-of-module correctly for *.ll and *.symtypes Masahiro Yamada
@ 2018-12-16 15:40 ` Masahiro Yamada
  3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-12-16 15:40 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Michal Marek, Linux Kernel Mailing List

On Tue, Dec 11, 2018 at 9:02 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> All objects in $(obj-m) are included in $(real-obj-m) as well.
>
> It is true composite objects are only contained in $(obj-m),
> but [M] is hard-coded in quiet_cmd_link_multi-m.
>
> This line is redundant.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Series, applied to linux-kbuild.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-16 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
2018-12-11 12:01 ` [PATCH 2/4] kbuild: refactor quiet_modtag Masahiro Yamada
2018-12-11 12:01 ` [PATCH 3/4] kbuild: refactor part-of-module Masahiro Yamada
2018-12-11 12:01 ` [PATCH 4/4] kbuild: handle part-of-module correctly for *.ll and *.symtypes Masahiro Yamada
2018-12-16 15:40 ` [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).