devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: dts: avoid unneeded built-in.a creation in vendor DTS directories
@ 2018-04-16 15:41 Masahiro Yamada
  2018-04-17 21:37 ` James Hogan
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2018-04-16 15:41 UTC (permalink / raw)
  To: Ralf Baechle, James Hogan, linux-mips
  Cc: Masahiro Yamada, Paul Cercueil, devicetree, Arnd Bergmann,
	Zubair Lutfullah Kakakhel, linux-kernel, Thomas Gleixner,
	Philippe Ombredanne, Mathieu Malaterre, Alexandre Belloni,
	Kate Stewart, Greg Kroah-Hartman, Mark Rutland, Rob Herring,
	Harvey Hunt

arch/mips/boot/dts/Makefile collects objects from sub-directories
into built-in.a only when CONFIG_BUILTIN_DTB is enabled.  Reflect
it also to the sub-directory Makefiles.  This suppresses unneeded
built-in.a creation in arch/mips/boot/dts/*/ directories.

While I am here, I replaced $(patsubst %.dtb, %.dtb.o, $(dtb-y))
with $(addsuffix .o, $(dtb-y)) to simplify the code a little bit.

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

 arch/mips/boot/dts/brcm/Makefile          | 2 +-
 arch/mips/boot/dts/cavium-octeon/Makefile | 2 +-
 arch/mips/boot/dts/ingenic/Makefile       | 2 +-
 arch/mips/boot/dts/lantiq/Makefile        | 2 +-
 arch/mips/boot/dts/mscc/Makefile          | 2 +-
 arch/mips/boot/dts/mti/Makefile           | 2 +-
 arch/mips/boot/dts/netlogic/Makefile      | 2 +-
 arch/mips/boot/dts/pic32/Makefile         | 2 +-
 arch/mips/boot/dts/ralink/Makefile        | 2 +-
 arch/mips/boot/dts/xilfpga/Makefile       | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/Makefile b/arch/mips/boot/dts/brcm/Makefile
index d8787c9..d85f446 100644
--- a/arch/mips/boot/dts/brcm/Makefile
+++ b/arch/mips/boot/dts/brcm/Makefile
@@ -34,4 +34,4 @@ dtb-$(CONFIG_DT_NONE) += \
 	bcm97425svmb.dtb \
 	bcm97435svmb.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/cavium-octeon/Makefile b/arch/mips/boot/dts/cavium-octeon/Makefile
index 24a8efc..17aef35 100644
--- a/arch/mips/boot/dts/cavium-octeon/Makefile
+++ b/arch/mips/boot/dts/cavium-octeon/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_CAVIUM_OCTEON_SOC)	+= octeon_3xxx.dtb octeon_68xx.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/ingenic/Makefile b/arch/mips/boot/dts/ingenic/Makefile
index 5b1361a..9cc4844 100644
--- a/arch/mips/boot/dts/ingenic/Makefile
+++ b/arch/mips/boot/dts/ingenic/Makefile
@@ -3,4 +3,4 @@ dtb-$(CONFIG_JZ4740_QI_LB60)	+= qi_lb60.dtb
 dtb-$(CONFIG_JZ4770_GCW0)	+= gcw0.dtb
 dtb-$(CONFIG_JZ4780_CI20)	+= ci20.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/lantiq/Makefile b/arch/mips/boot/dts/lantiq/Makefile
index 51ab9c1..f5dfc06 100644
--- a/arch/mips/boot/dts/lantiq/Makefile
+++ b/arch/mips/boot/dts/lantiq/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_DT_EASY50712)	+= easy50712.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/mscc/Makefile b/arch/mips/boot/dts/mscc/Makefile
index c511645..3c6aed9 100644
--- a/arch/mips/boot/dts/mscc/Makefile
+++ b/arch/mips/boot/dts/mscc/Makefile
@@ -1,3 +1,3 @@
 dtb-$(CONFIG_LEGACY_BOARD_OCELOT)	+= ocelot_pcb123.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/mti/Makefile b/arch/mips/boot/dts/mti/Makefile
index 3508720..b5f7426 100644
--- a/arch/mips/boot/dts/mti/Makefile
+++ b/arch/mips/boot/dts/mti/Makefile
@@ -2,4 +2,4 @@
 dtb-$(CONFIG_MIPS_MALTA)	+= malta.dtb
 dtb-$(CONFIG_LEGACY_BOARD_SEAD3)	+= sead3.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/netlogic/Makefile b/arch/mips/boot/dts/netlogic/Makefile
index d630b27..45af422 100644
--- a/arch/mips/boot/dts/netlogic/Makefile
+++ b/arch/mips/boot/dts/netlogic/Makefile
@@ -5,4 +5,4 @@ dtb-$(CONFIG_DT_XLP_FVP)	+= xlp_fvp.dtb
 dtb-$(CONFIG_DT_XLP_GVP)	+= xlp_gvp.dtb
 dtb-$(CONFIG_DT_XLP_RVP)	+= xlp_rvp.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/pic32/Makefile b/arch/mips/boot/dts/pic32/Makefile
index ba9bcef..fb57f36 100644
--- a/arch/mips/boot/dts/pic32/Makefile
+++ b/arch/mips/boot/dts/pic32/Makefile
@@ -4,4 +4,4 @@ dtb-$(CONFIG_DTB_PIC32_MZDA_SK)		+= pic32mzda_sk.dtb
 dtb-$(CONFIG_DTB_PIC32_NONE)		+= \
 					pic32mzda_sk.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/ralink/Makefile b/arch/mips/boot/dts/ralink/Makefile
index 94bee5b..6c26dfa 100644
--- a/arch/mips/boot/dts/ralink/Makefile
+++ b/arch/mips/boot/dts/ralink/Makefile
@@ -6,4 +6,4 @@ dtb-$(CONFIG_DTB_MT7620A_EVAL)	+= mt7620a_eval.dtb
 dtb-$(CONFIG_DTB_OMEGA2P)	+= omega2p.dtb
 dtb-$(CONFIG_DTB_VOCORE2)	+= vocore2.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
index 9987e0e3..285973f 100644
--- a/arch/mips/boot/dts/xilfpga/Makefile
+++ b/arch/mips/boot/dts/xilfpga/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA)	+= nexys4ddr.dtb
 
-obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))
-- 
2.7.4

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

* Re: [PATCH] MIPS: dts: avoid unneeded built-in.a creation in vendor DTS directories
  2018-04-16 15:41 [PATCH] MIPS: dts: avoid unneeded built-in.a creation in vendor DTS directories Masahiro Yamada
@ 2018-04-17 21:37 ` James Hogan
  0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2018-04-17 21:37 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Ralf Baechle, linux-mips, Paul Cercueil, devicetree,
	Arnd Bergmann, Zubair Lutfullah Kakakhel, linux-kernel,
	Thomas Gleixner, Philippe Ombredanne, Mathieu Malaterre,
	Alexandre Belloni, Kate Stewart, Greg Kroah-Hartman, Mark Rutland,
	Rob Herring, Harvey Hunt

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

On Tue, Apr 17, 2018 at 12:41:30AM +0900, Masahiro Yamada wrote:
> arch/mips/boot/dts/Makefile collects objects from sub-directories
> into built-in.a only when CONFIG_BUILTIN_DTB is enabled.  Reflect
> it also to the sub-directory Makefiles.  This suppresses unneeded
> built-in.a creation in arch/mips/boot/dts/*/ directories.
> 
> While I am here, I replaced $(patsubst %.dtb, %.dtb.o, $(dtb-y))
> with $(addsuffix .o, $(dtb-y)) to simplify the code a little bit.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  arch/mips/boot/dts/brcm/Makefile          | 2 +-
>  arch/mips/boot/dts/cavium-octeon/Makefile | 2 +-
>  arch/mips/boot/dts/ingenic/Makefile       | 2 +-
>  arch/mips/boot/dts/lantiq/Makefile        | 2 +-
>  arch/mips/boot/dts/mscc/Makefile          | 2 +-
>  arch/mips/boot/dts/mti/Makefile           | 2 +-
>  arch/mips/boot/dts/netlogic/Makefile      | 2 +-
>  arch/mips/boot/dts/pic32/Makefile         | 2 +-
>  arch/mips/boot/dts/ralink/Makefile        | 2 +-
>  arch/mips/boot/dts/xilfpga/Makefile       | 2 +-
>  10 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/mips/boot/dts/brcm/Makefile b/arch/mips/boot/dts/brcm/Makefile
> index d8787c9..d85f446 100644
> --- a/arch/mips/boot/dts/brcm/Makefile
> +++ b/arch/mips/boot/dts/brcm/Makefile
> @@ -34,4 +34,4 @@ dtb-$(CONFIG_DT_NONE) += \
>  	bcm97425svmb.dtb \
>  	bcm97435svmb.dtb
>  
> -obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
> +obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))

I like this. I had also spotted the .o files being unnecessarily
generated when building the dtbs target with bmips and CONFIG_DT_NONE=y.
I'll apply for 4.18.

Thanks
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-04-17 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-16 15:41 [PATCH] MIPS: dts: avoid unneeded built-in.a creation in vendor DTS directories Masahiro Yamada
2018-04-17 21:37 ` James Hogan

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).