linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mips: decompressor: do not copy source files while building
@ 2021-11-05  2:38 Masahiro Yamada
  2021-11-09 12:10 ` Paul Cercueil
  2021-11-10  8:49 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-05  2:38 UTC (permalink / raw)
  To: Thomas Bogendoerfer, linux-mips
  Cc: Masahiro Yamada, Alexander Lobakin, Arnd Bergmann, Paul Cercueil,
	Xingxing Su, linux-kernel, zhaoxiao

As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
builds") stated, copying source files during the build time may not
end up with as clean code as expected.

Do similar for mips to clean up the Makefile and .gitignore.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/mips/boot/compressed/.gitignore   |  3 ---
 arch/mips/boot/compressed/Makefile     | 12 ------------
 arch/mips/boot/compressed/ashldi3.c    |  2 ++
 arch/mips/boot/compressed/bswapsi.c    |  2 ++
 arch/mips/boot/compressed/uart-ath79.c |  2 ++
 scripts/remove-stale-files             |  5 +++++
 6 files changed, 11 insertions(+), 15 deletions(-)
 delete mode 100644 arch/mips/boot/compressed/.gitignore
 create mode 100644 arch/mips/boot/compressed/ashldi3.c
 create mode 100644 arch/mips/boot/compressed/bswapsi.c
 create mode 100644 arch/mips/boot/compressed/uart-ath79.c

diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
deleted file mode 100644
index d358395614c9..000000000000
--- a/arch/mips/boot/compressed/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-ashldi3.c
-bswapsi.c
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 3548b3b45269..e6584dab2360 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)		   += $(obj)/uart-alchemy.o
 vmlinuzobjs-$(CONFIG_ATH79)			   += $(obj)/uart-ath79.o
 endif
 
-extra-y += uart-ath79.c
-$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
-	$(call cmd,shipped)
-
 vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
 
-extra-y += ashldi3.c
-$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
-	$(call if_changed,shipped)
-
-extra-y += bswapsi.c
-$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
-	$(call if_changed,shipped)
-
 targets := $(notdir $(vmlinuzobjs-y))
 
 targets += vmlinux.bin
diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
new file mode 100644
index 000000000000..f7bf6a7aae31
--- /dev/null
+++ b/arch/mips/boot/compressed/ashldi3.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../../../lib/ashldi3.c"
diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
new file mode 100644
index 000000000000..fdb9c6476904
--- /dev/null
+++ b/arch/mips/boot/compressed/bswapsi.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../lib/bswapsi.c"
diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
new file mode 100644
index 000000000000..d686820921be
--- /dev/null
+++ b/arch/mips/boot/compressed/uart-ath79.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../ath79/early_printk.c"
diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
index eb630ee287c3..c534fe1eac16 100755
--- a/scripts/remove-stale-files
+++ b/scripts/remove-stale-files
@@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
 	do
 		rm -f arch/arm/boot/compressed/${f}
 	done
+
+	for f in uart-ath79.c ashldi3.c bswapsi.c
+	do
+		rm -f arch/mips/boot/compressed/${f}
+	done
 fi
-- 
2.30.2


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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-05  2:38 [PATCH] mips: decompressor: do not copy source files while building Masahiro Yamada
@ 2021-11-09 12:10 ` Paul Cercueil
  2021-11-09 16:57   ` Masahiro Yamada
  2021-11-10  8:49 ` Thomas Bogendoerfer
  1 sibling, 1 reply; 11+ messages in thread
From: Paul Cercueil @ 2021-11-09 12:10 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Thomas Bogendoerfer, linux-mips, Alexander Lobakin,
	Arnd Bergmann, Xingxing Su, linux-kernel, zhaoxiao

Hi Masahiro,

Le ven., nov. 5 2021 at 11:38:14 +0900, Masahiro Yamada 
<masahiroy@kernel.org> a écrit :
> As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> builds") stated, copying source files during the build time may not
> end up with as clean code as expected.
> 
> Do similar for mips to clean up the Makefile and .gitignore.

What did you base this patch on?

It does not apply cleanly here. It tries to create ashldi3.c and 
bswapsi.c, which already exist.

Cheers,
-Paul

> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  arch/mips/boot/compressed/.gitignore   |  3 ---
>  arch/mips/boot/compressed/Makefile     | 12 ------------
>  arch/mips/boot/compressed/ashldi3.c    |  2 ++
>  arch/mips/boot/compressed/bswapsi.c    |  2 ++
>  arch/mips/boot/compressed/uart-ath79.c |  2 ++
>  scripts/remove-stale-files             |  5 +++++
>  6 files changed, 11 insertions(+), 15 deletions(-)
>  delete mode 100644 arch/mips/boot/compressed/.gitignore
>  create mode 100644 arch/mips/boot/compressed/ashldi3.c
>  create mode 100644 arch/mips/boot/compressed/bswapsi.c
>  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> 
> diff --git a/arch/mips/boot/compressed/.gitignore 
> b/arch/mips/boot/compressed/.gitignore
> deleted file mode 100644
> index d358395614c9..000000000000
> --- a/arch/mips/boot/compressed/.gitignore
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -ashldi3.c
> -bswapsi.c
> diff --git a/arch/mips/boot/compressed/Makefile 
> b/arch/mips/boot/compressed/Makefile
> index 3548b3b45269..e6584dab2360 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)		   += 
> $(obj)/uart-alchemy.o
>  vmlinuzobjs-$(CONFIG_ATH79)			   += $(obj)/uart-ath79.o
>  endif
> 
> -extra-y += uart-ath79.c
> -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> -	$(call cmd,shipped)
> -
>  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> 
> -extra-y += ashldi3.c
> -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> -	$(call if_changed,shipped)
> -
> -extra-y += bswapsi.c
> -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> -	$(call if_changed,shipped)
> -
>  targets := $(notdir $(vmlinuzobjs-y))
> 
>  targets += vmlinux.bin
> diff --git a/arch/mips/boot/compressed/ashldi3.c 
> b/arch/mips/boot/compressed/ashldi3.c
> new file mode 100644
> index 000000000000..f7bf6a7aae31
> --- /dev/null
> +++ b/arch/mips/boot/compressed/ashldi3.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../../../lib/ashldi3.c"
> diff --git a/arch/mips/boot/compressed/bswapsi.c 
> b/arch/mips/boot/compressed/bswapsi.c
> new file mode 100644
> index 000000000000..fdb9c6476904
> --- /dev/null
> +++ b/arch/mips/boot/compressed/bswapsi.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../lib/bswapsi.c"
> diff --git a/arch/mips/boot/compressed/uart-ath79.c 
> b/arch/mips/boot/compressed/uart-ath79.c
> new file mode 100644
> index 000000000000..d686820921be
> --- /dev/null
> +++ b/arch/mips/boot/compressed/uart-ath79.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../ath79/early_printk.c"
> diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> index eb630ee287c3..c534fe1eac16 100755
> --- a/scripts/remove-stale-files
> +++ b/scripts/remove-stale-files
> @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
>  	do
>  		rm -f arch/arm/boot/compressed/${f}
>  	done
> +
> +	for f in uart-ath79.c ashldi3.c bswapsi.c
> +	do
> +		rm -f arch/mips/boot/compressed/${f}
> +	done
>  fi
> --
> 2.30.2
> 



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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-09 12:10 ` Paul Cercueil
@ 2021-11-09 16:57   ` Masahiro Yamada
  2021-11-09 20:28     ` Paul Cercueil
  0 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-09 16:57 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Thomas Bogendoerfer, open list:BROADCOM NVRAM DRIVER,
	Alexander Lobakin, Arnd Bergmann, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Tue, Nov 9, 2021 at 9:10 PM Paul Cercueil <paul@crapouillou.net> wrote:
>
> Hi Masahiro,
>
> Le ven., nov. 5 2021 at 11:38:14 +0900, Masahiro Yamada
> <masahiroy@kernel.org> a écrit :
> > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > builds") stated, copying source files during the build time may not
> > end up with as clean code as expected.
> >
> > Do similar for mips to clean up the Makefile and .gitignore.
>
> What did you base this patch on?
>
> It does not apply cleanly here. It tries to create ashldi3.c and
> bswapsi.c, which already exist.
>

Please remove them manually
before 'git am'.


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-09 16:57   ` Masahiro Yamada
@ 2021-11-09 20:28     ` Paul Cercueil
  0 siblings, 0 replies; 11+ messages in thread
From: Paul Cercueil @ 2021-11-09 20:28 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Thomas Bogendoerfer, BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Xingxing Su, Linux Kernel Mailing List, zhaoxiao

Hi,

Le mer., nov. 10 2021 at 01:57:28 +0900, Masahiro Yamada 
<masahiroy@kernel.org> a écrit :
> On Tue, Nov 9, 2021 at 9:10 PM Paul Cercueil <paul@crapouillou.net> 
> wrote:
>> 
>>  Hi Masahiro,
>> 
>>  Le ven., nov. 5 2021 at 11:38:14 +0900, Masahiro Yamada
>>  <masahiroy@kernel.org> a écrit :
>>  > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify 
>> libfdt
>>  > builds") stated, copying source files during the build time may 
>> not
>>  > end up with as clean code as expected.
>>  >
>>  > Do similar for mips to clean up the Makefile and .gitignore.
>> 
>>  What did you base this patch on?
>> 
>>  It does not apply cleanly here. It tries to create ashldi3.c and
>>  bswapsi.c, which already exist.
>> 
> 
> Please remove them manually
> before 'git am'.

That works. I thought these files were staged in git.

Tested-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul



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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-05  2:38 [PATCH] mips: decompressor: do not copy source files while building Masahiro Yamada
  2021-11-09 12:10 ` Paul Cercueil
@ 2021-11-10  8:49 ` Thomas Bogendoerfer
  2021-11-10 17:02   ` Masahiro Yamada
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Bogendoerfer @ 2021-11-10  8:49 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mips, Alexander Lobakin, Arnd Bergmann, Paul Cercueil,
	Xingxing Su, linux-kernel, zhaoxiao

On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> builds") stated, copying source files during the build time may not
> end up with as clean code as expected.
> 
> Do similar for mips to clean up the Makefile and .gitignore.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  arch/mips/boot/compressed/.gitignore   |  3 ---
>  arch/mips/boot/compressed/Makefile     | 12 ------------
>  arch/mips/boot/compressed/ashldi3.c    |  2 ++
>  arch/mips/boot/compressed/bswapsi.c    |  2 ++
>  arch/mips/boot/compressed/uart-ath79.c |  2 ++
>  scripts/remove-stale-files             |  5 +++++
>  6 files changed, 11 insertions(+), 15 deletions(-)
>  delete mode 100644 arch/mips/boot/compressed/.gitignore
>  create mode 100644 arch/mips/boot/compressed/ashldi3.c
>  create mode 100644 arch/mips/boot/compressed/bswapsi.c
>  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> 
> diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> deleted file mode 100644
> index d358395614c9..000000000000
> --- a/arch/mips/boot/compressed/.gitignore
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -ashldi3.c
> -bswapsi.c
> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> index 3548b3b45269..e6584dab2360 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)		   += $(obj)/uart-alchemy.o
>  vmlinuzobjs-$(CONFIG_ATH79)			   += $(obj)/uart-ath79.o
>  endif
>  
> -extra-y += uart-ath79.c
> -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> -	$(call cmd,shipped)
> -
>  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
>  
> -extra-y += ashldi3.c
> -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> -	$(call if_changed,shipped)
> -
> -extra-y += bswapsi.c
> -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> -	$(call if_changed,shipped)
> -
>  targets := $(notdir $(vmlinuzobjs-y))
>  
>  targets += vmlinux.bin
> diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> new file mode 100644
> index 000000000000..f7bf6a7aae31
> --- /dev/null
> +++ b/arch/mips/boot/compressed/ashldi3.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../../../lib/ashldi3.c"
> diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> new file mode 100644
> index 000000000000..fdb9c6476904
> --- /dev/null
> +++ b/arch/mips/boot/compressed/bswapsi.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../lib/bswapsi.c"
> diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> new file mode 100644
> index 000000000000..d686820921be
> --- /dev/null
> +++ b/arch/mips/boot/compressed/uart-ath79.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../ath79/early_printk.c"
> diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> index eb630ee287c3..c534fe1eac16 100755
> --- a/scripts/remove-stale-files
> +++ b/scripts/remove-stale-files
> @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
>  	do
>  		rm -f arch/arm/boot/compressed/${f}
>  	done
> +
> +	for f in uart-ath79.c ashldi3.c bswapsi.c
> +	do
> +		rm -f arch/mips/boot/compressed/${f}
> +	done

hmm, isn't this the wrong action now that these files have been added
to git ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-10  8:49 ` Thomas Bogendoerfer
@ 2021-11-10 17:02   ` Masahiro Yamada
  2021-11-10 18:52     ` Thomas Bogendoerfer
  0 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-10 17:02 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > builds") stated, copying source files during the build time may not
> > end up with as clean code as expected.
> >
> > Do similar for mips to clean up the Makefile and .gitignore.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  arch/mips/boot/compressed/.gitignore   |  3 ---
> >  arch/mips/boot/compressed/Makefile     | 12 ------------
> >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> >  scripts/remove-stale-files             |  5 +++++
> >  6 files changed, 11 insertions(+), 15 deletions(-)
> >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> >
> > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > deleted file mode 100644
> > index d358395614c9..000000000000
> > --- a/arch/mips/boot/compressed/.gitignore
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -# SPDX-License-Identifier: GPL-2.0-only
> > -ashldi3.c
> > -bswapsi.c
> > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > index 3548b3b45269..e6584dab2360 100644
> > --- a/arch/mips/boot/compressed/Makefile
> > +++ b/arch/mips/boot/compressed/Makefile
> > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> >  endif
> >
> > -extra-y += uart-ath79.c
> > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > -     $(call cmd,shipped)
> > -
> >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> >
> > -extra-y += ashldi3.c
> > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > -     $(call if_changed,shipped)
> > -
> > -extra-y += bswapsi.c
> > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > -     $(call if_changed,shipped)
> > -
> >  targets := $(notdir $(vmlinuzobjs-y))
> >
> >  targets += vmlinux.bin
> > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > new file mode 100644
> > index 000000000000..f7bf6a7aae31
> > --- /dev/null
> > +++ b/arch/mips/boot/compressed/ashldi3.c
> > @@ -0,0 +1,2 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +#include "../../../../lib/ashldi3.c"
> > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > new file mode 100644
> > index 000000000000..fdb9c6476904
> > --- /dev/null
> > +++ b/arch/mips/boot/compressed/bswapsi.c
> > @@ -0,0 +1,2 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +#include "../../lib/bswapsi.c"
> > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > new file mode 100644
> > index 000000000000..d686820921be
> > --- /dev/null
> > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > @@ -0,0 +1,2 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +#include "../../ath79/early_printk.c"
> > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > index eb630ee287c3..c534fe1eac16 100755
> > --- a/scripts/remove-stale-files
> > +++ b/scripts/remove-stale-files
> > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> >       do
> >               rm -f arch/arm/boot/compressed/${f}
> >       done
> > +
> > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > +     do
> > +             rm -f arch/mips/boot/compressed/${f}
> > +     done
>
> hmm, isn't this the wrong action now that these files have been added
> to git ?
>
> Thomas.


Please note that the entire code block is enclosed by:

if [ -n "${building_out_of_srctree}" ]; then
           ...
fi


"building_out_of_srctree" is set when you are doing
out-of-tree build  (O=<output-dir>).

So, only the generated files are removed.




-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-10 17:02   ` Masahiro Yamada
@ 2021-11-10 18:52     ` Thomas Bogendoerfer
  2021-11-11  2:58       ` Masahiro Yamada
  2021-11-11  7:55       ` Masahiro Yamada
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Bogendoerfer @ 2021-11-10 18:52 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Thu, Nov 11, 2021 at 02:02:32AM +0900, Masahiro Yamada wrote:
> On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
> <tsbogend@alpha.franken.de> wrote:
> >
> > On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > > builds") stated, copying source files during the build time may not
> > > end up with as clean code as expected.
> > >
> > > Do similar for mips to clean up the Makefile and .gitignore.
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > >  arch/mips/boot/compressed/.gitignore   |  3 ---
> > >  arch/mips/boot/compressed/Makefile     | 12 ------------
> > >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> > >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> > >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> > >  scripts/remove-stale-files             |  5 +++++
> > >  6 files changed, 11 insertions(+), 15 deletions(-)
> > >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> > >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> > >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> > >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> > >
> > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > > deleted file mode 100644
> > > index d358395614c9..000000000000
> > > --- a/arch/mips/boot/compressed/.gitignore
> > > +++ /dev/null
> > > @@ -1,3 +0,0 @@
> > > -# SPDX-License-Identifier: GPL-2.0-only
> > > -ashldi3.c
> > > -bswapsi.c
> > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > > index 3548b3b45269..e6584dab2360 100644
> > > --- a/arch/mips/boot/compressed/Makefile
> > > +++ b/arch/mips/boot/compressed/Makefile
> > > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> > >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> > >  endif
> > >
> > > -extra-y += uart-ath79.c
> > > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > > -     $(call cmd,shipped)
> > > -
> > >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> > >
> > > -extra-y += ashldi3.c
> > > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > > -     $(call if_changed,shipped)
> > > -
> > > -extra-y += bswapsi.c
> > > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > > -     $(call if_changed,shipped)
> > > -
> > >  targets := $(notdir $(vmlinuzobjs-y))
> > >
> > >  targets += vmlinux.bin
> > > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > > new file mode 100644
> > > index 000000000000..f7bf6a7aae31
> > > --- /dev/null
> > > +++ b/arch/mips/boot/compressed/ashldi3.c
> > > @@ -0,0 +1,2 @@
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > > +#include "../../../../lib/ashldi3.c"
> > > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > > new file mode 100644
> > > index 000000000000..fdb9c6476904
> > > --- /dev/null
> > > +++ b/arch/mips/boot/compressed/bswapsi.c
> > > @@ -0,0 +1,2 @@
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > > +#include "../../lib/bswapsi.c"
> > > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > > new file mode 100644
> > > index 000000000000..d686820921be
> > > --- /dev/null
> > > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > > @@ -0,0 +1,2 @@
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > > +#include "../../ath79/early_printk.c"
> > > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > > index eb630ee287c3..c534fe1eac16 100755
> > > --- a/scripts/remove-stale-files
> > > +++ b/scripts/remove-stale-files
> > > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> > >       do
> > >               rm -f arch/arm/boot/compressed/${f}
> > >       done
> > > +
> > > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > > +     do
> > > +             rm -f arch/mips/boot/compressed/${f}
> > > +     done
> >
> > hmm, isn't this the wrong action now that these files have been added
> > to git ?
> >
> > Thomas.
> 
> 
> Please note that the entire code block is enclosed by:
> 
> if [ -n "${building_out_of_srctree}" ]; then
>            ...
> fi
> 
> 
> "building_out_of_srctree" is set when you are doing
> out-of-tree build  (O=<output-dir>).
> 
> So, only the generated files are removed.

but there aren't copied/generated any longer or I'm missing someting ?

Anyway I've applied your patch to mips-next with changes to also cover

https://patchwork.kernel.org/project/linux-mips/patch/20211110030944.6733-1-rdunlap@infradead.org/

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-10 18:52     ` Thomas Bogendoerfer
@ 2021-11-11  2:58       ` Masahiro Yamada
  2021-11-11  7:55       ` Masahiro Yamada
  1 sibling, 0 replies; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-11  2:58 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Thu, Nov 11, 2021 at 3:52 AM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Thu, Nov 11, 2021 at 02:02:32AM +0900, Masahiro Yamada wrote:
> > On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
> > <tsbogend@alpha.franken.de> wrote:
> > >
> > > On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > > > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > > > builds") stated, copying source files during the build time may not
> > > > end up with as clean code as expected.
> > > >
> > > > Do similar for mips to clean up the Makefile and .gitignore.
> > > >
> > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > > ---
> > > >
> > > >  arch/mips/boot/compressed/.gitignore   |  3 ---
> > > >  arch/mips/boot/compressed/Makefile     | 12 ------------
> > > >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> > > >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> > > >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> > > >  scripts/remove-stale-files             |  5 +++++
> > > >  6 files changed, 11 insertions(+), 15 deletions(-)
> > > >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> > > >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> > > >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> > > >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> > > >
> > > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > > > deleted file mode 100644
> > > > index d358395614c9..000000000000
> > > > --- a/arch/mips/boot/compressed/.gitignore
> > > > +++ /dev/null
> > > > @@ -1,3 +0,0 @@
> > > > -# SPDX-License-Identifier: GPL-2.0-only
> > > > -ashldi3.c
> > > > -bswapsi.c
> > > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > > > index 3548b3b45269..e6584dab2360 100644
> > > > --- a/arch/mips/boot/compressed/Makefile
> > > > +++ b/arch/mips/boot/compressed/Makefile
> > > > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> > > >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> > > >  endif
> > > >
> > > > -extra-y += uart-ath79.c
> > > > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > > > -     $(call cmd,shipped)
> > > > -
> > > >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> > > >
> > > > -extra-y += ashldi3.c
> > > > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > > > -     $(call if_changed,shipped)
> > > > -
> > > > -extra-y += bswapsi.c
> > > > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > > > -     $(call if_changed,shipped)
> > > > -
> > > >  targets := $(notdir $(vmlinuzobjs-y))
> > > >
> > > >  targets += vmlinux.bin
> > > > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > > > new file mode 100644
> > > > index 000000000000..f7bf6a7aae31
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/ashldi3.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../../../lib/ashldi3.c"
> > > > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > > > new file mode 100644
> > > > index 000000000000..fdb9c6476904
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/bswapsi.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../lib/bswapsi.c"
> > > > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > > > new file mode 100644
> > > > index 000000000000..d686820921be
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../ath79/early_printk.c"
> > > > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > > > index eb630ee287c3..c534fe1eac16 100755
> > > > --- a/scripts/remove-stale-files
> > > > +++ b/scripts/remove-stale-files
> > > > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> > > >       do
> > > >               rm -f arch/arm/boot/compressed/${f}
> > > >       done
> > > > +
> > > > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > > > +     do
> > > > +             rm -f arch/mips/boot/compressed/${f}
> > > > +     done
> > >
> > > hmm, isn't this the wrong action now that these files have been added
> > > to git ?
> > >
> > > Thomas.
> >
> >
> > Please note that the entire code block is enclosed by:
> >
> > if [ -n "${building_out_of_srctree}" ]; then
> >            ...
> > fi
> >
> >
> > "building_out_of_srctree" is set when you are doing
> > out-of-tree build  (O=<output-dir>).
> >
> > So, only the generated files are removed.
>
> but there aren't copied/generated any longer or I'm missing someting ?


People do "git pull" without cleaning the tree.
(and we should not require users to do "make clean")


[1]  ashldi3.c and bswapsi.c will be remaining
      in the build directory, which were generated
      by an older commit

[2] ashldi3.c and bswapsi.c will be added to the
     source tree when people pull this commit



[1] takes precedence over [2].

So, old files will be compiled. This is a problem.

That's why I am removing [1] for O= builds.




>
> Anyway I've applied your patch to mips-next with changes to also cover
>
> https://patchwork.kernel.org/project/linux-mips/patch/20211110030944.6733-1-rdunlap@infradead.org/
>
> Thomas.
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-10 18:52     ` Thomas Bogendoerfer
  2021-11-11  2:58       ` Masahiro Yamada
@ 2021-11-11  7:55       ` Masahiro Yamada
  2021-11-11  8:14         ` Thomas Bogendoerfer
  1 sibling, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-11  7:55 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Thu, Nov 11, 2021 at 3:52 AM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Thu, Nov 11, 2021 at 02:02:32AM +0900, Masahiro Yamada wrote:
> > On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
> > <tsbogend@alpha.franken.de> wrote:
> > >
> > > On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > > > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > > > builds") stated, copying source files during the build time may not
> > > > end up with as clean code as expected.
> > > >
> > > > Do similar for mips to clean up the Makefile and .gitignore.
> > > >
> > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > > ---
> > > >
> > > >  arch/mips/boot/compressed/.gitignore   |  3 ---
> > > >  arch/mips/boot/compressed/Makefile     | 12 ------------
> > > >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> > > >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> > > >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> > > >  scripts/remove-stale-files             |  5 +++++
> > > >  6 files changed, 11 insertions(+), 15 deletions(-)
> > > >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> > > >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> > > >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> > > >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> > > >
> > > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > > > deleted file mode 100644
> > > > index d358395614c9..000000000000
> > > > --- a/arch/mips/boot/compressed/.gitignore
> > > > +++ /dev/null
> > > > @@ -1,3 +0,0 @@
> > > > -# SPDX-License-Identifier: GPL-2.0-only
> > > > -ashldi3.c
> > > > -bswapsi.c
> > > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > > > index 3548b3b45269..e6584dab2360 100644
> > > > --- a/arch/mips/boot/compressed/Makefile
> > > > +++ b/arch/mips/boot/compressed/Makefile
> > > > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> > > >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> > > >  endif
> > > >
> > > > -extra-y += uart-ath79.c
> > > > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > > > -     $(call cmd,shipped)
> > > > -
> > > >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> > > >
> > > > -extra-y += ashldi3.c
> > > > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > > > -     $(call if_changed,shipped)
> > > > -
> > > > -extra-y += bswapsi.c
> > > > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > > > -     $(call if_changed,shipped)
> > > > -
> > > >  targets := $(notdir $(vmlinuzobjs-y))
> > > >
> > > >  targets += vmlinux.bin
> > > > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > > > new file mode 100644
> > > > index 000000000000..f7bf6a7aae31
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/ashldi3.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../../../lib/ashldi3.c"
> > > > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > > > new file mode 100644
> > > > index 000000000000..fdb9c6476904
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/bswapsi.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../lib/bswapsi.c"
> > > > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > > > new file mode 100644
> > > > index 000000000000..d686820921be
> > > > --- /dev/null
> > > > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > > > @@ -0,0 +1,2 @@
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > +#include "../../ath79/early_printk.c"
> > > > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > > > index eb630ee287c3..c534fe1eac16 100755
> > > > --- a/scripts/remove-stale-files
> > > > +++ b/scripts/remove-stale-files
> > > > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> > > >       do
> > > >               rm -f arch/arm/boot/compressed/${f}
> > > >       done
> > > > +
> > > > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > > > +     do
> > > > +             rm -f arch/mips/boot/compressed/${f}
> > > > +     done
> > >
> > > hmm, isn't this the wrong action now that these files have been added
> > > to git ?
> > >
> > > Thomas.
> >
> >
> > Please note that the entire code block is enclosed by:
> >
> > if [ -n "${building_out_of_srctree}" ]; then
> >            ...
> > fi
> >
> >
> > "building_out_of_srctree" is set when you are doing
> > out-of-tree build  (O=<output-dir>).
> >
> > So, only the generated files are removed.
>
> but there aren't copied/generated any longer or I'm missing someting ?
>
> Anyway I've applied your patch to mips-next with changes to also cover
>
> https://patchwork.kernel.org/project/linux-mips/patch/20211110030944.6733-1-rdunlap@infradead.org/
>


Your conversion is wrong.

The original code:

$(obj)/bswapdi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
        $(call if_changed,shipped)


copied mips-specific library code
(arch/mips/lib/bswapdi.c)


Now, you do

#include "../../../../lib/ashldi3.c"

, which wraps the generic library code
(lib/ashldi3.c)







-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-11  7:55       ` Masahiro Yamada
@ 2021-11-11  8:14         ` Thomas Bogendoerfer
  2021-11-11  8:24           ` Masahiro Yamada
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Bogendoerfer @ 2021-11-11  8:14 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Thu, Nov 11, 2021 at 04:55:35PM +0900, Masahiro Yamada wrote:
> On Thu, Nov 11, 2021 at 3:52 AM Thomas Bogendoerfer
> <tsbogend@alpha.franken.de> wrote:
> >
> > On Thu, Nov 11, 2021 at 02:02:32AM +0900, Masahiro Yamada wrote:
> > > On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
> > > <tsbogend@alpha.franken.de> wrote:
> > > >
> > > > On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > > > > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > > > > builds") stated, copying source files during the build time may not
> > > > > end up with as clean code as expected.
> > > > >
> > > > > Do similar for mips to clean up the Makefile and .gitignore.
> > > > >
> > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > > > ---
> > > > >
> > > > >  arch/mips/boot/compressed/.gitignore   |  3 ---
> > > > >  arch/mips/boot/compressed/Makefile     | 12 ------------
> > > > >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> > > > >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> > > > >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> > > > >  scripts/remove-stale-files             |  5 +++++
> > > > >  6 files changed, 11 insertions(+), 15 deletions(-)
> > > > >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> > > > >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> > > > >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> > > > >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> > > > >
> > > > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > > > > deleted file mode 100644
> > > > > index d358395614c9..000000000000
> > > > > --- a/arch/mips/boot/compressed/.gitignore
> > > > > +++ /dev/null
> > > > > @@ -1,3 +0,0 @@
> > > > > -# SPDX-License-Identifier: GPL-2.0-only
> > > > > -ashldi3.c
> > > > > -bswapsi.c
> > > > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > > > > index 3548b3b45269..e6584dab2360 100644
> > > > > --- a/arch/mips/boot/compressed/Makefile
> > > > > +++ b/arch/mips/boot/compressed/Makefile
> > > > > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> > > > >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> > > > >  endif
> > > > >
> > > > > -extra-y += uart-ath79.c
> > > > > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > > > > -     $(call cmd,shipped)
> > > > > -
> > > > >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> > > > >
> > > > > -extra-y += ashldi3.c
> > > > > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > > > > -     $(call if_changed,shipped)
> > > > > -
> > > > > -extra-y += bswapsi.c
> > > > > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > > > > -     $(call if_changed,shipped)
> > > > > -
> > > > >  targets := $(notdir $(vmlinuzobjs-y))
> > > > >
> > > > >  targets += vmlinux.bin
> > > > > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > > > > new file mode 100644
> > > > > index 000000000000..f7bf6a7aae31
> > > > > --- /dev/null
> > > > > +++ b/arch/mips/boot/compressed/ashldi3.c
> > > > > @@ -0,0 +1,2 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > +#include "../../../../lib/ashldi3.c"
> > > > > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > > > > new file mode 100644
> > > > > index 000000000000..fdb9c6476904
> > > > > --- /dev/null
> > > > > +++ b/arch/mips/boot/compressed/bswapsi.c
> > > > > @@ -0,0 +1,2 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > +#include "../../lib/bswapsi.c"
> > > > > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > > > > new file mode 100644
> > > > > index 000000000000..d686820921be
> > > > > --- /dev/null
> > > > > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > > > > @@ -0,0 +1,2 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > +#include "../../ath79/early_printk.c"
> > > > > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > > > > index eb630ee287c3..c534fe1eac16 100755
> > > > > --- a/scripts/remove-stale-files
> > > > > +++ b/scripts/remove-stale-files
> > > > > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> > > > >       do
> > > > >               rm -f arch/arm/boot/compressed/${f}
> > > > >       done
> > > > > +
> > > > > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > > > > +     do
> > > > > +             rm -f arch/mips/boot/compressed/${f}
> > > > > +     done
> > > >
> > > > hmm, isn't this the wrong action now that these files have been added
> > > > to git ?
> > > >
> > > > Thomas.
> > >
> > >
> > > Please note that the entire code block is enclosed by:
> > >
> > > if [ -n "${building_out_of_srctree}" ]; then
> > >            ...
> > > fi
> > >
> > >
> > > "building_out_of_srctree" is set when you are doing
> > > out-of-tree build  (O=<output-dir>).
> > >
> > > So, only the generated files are removed.
> >
> > but there aren't copied/generated any longer or I'm missing someting ?
> >
> > Anyway I've applied your patch to mips-next with changes to also cover
> >
> > https://patchwork.kernel.org/project/linux-mips/patch/20211110030944.6733-1-rdunlap@infradead.org/
> >
> 
> 
> Your conversion is wrong.
> 
> The original code:
> 
> $(obj)/bswapdi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
>         $(call if_changed,shipped)
> 
> 
> copied mips-specific library code
> (arch/mips/lib/bswapdi.c)
> 
> 
> Now, you do
> 
> #include "../../../../lib/ashldi3.c"
> 
> , which wraps the generic library code
> (lib/ashldi3.c)

arch/mips/boot/compressed/bswapdi.c in my tree is 

diff --git a/arch/mips/boot/compressed/bswapdi.c b/arch/mips/boot/compressed/bswapdi.c
new file mode 100644
index 000000000000..acb28aebb025
--- /dev/null
+++ b/arch/mips/boot/compressed/bswapdi.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../lib/bswapdi.c"

which looks correct to me.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH] mips: decompressor: do not copy source files while building
  2021-11-11  8:14         ` Thomas Bogendoerfer
@ 2021-11-11  8:24           ` Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: Masahiro Yamada @ 2021-11-11  8:24 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: open list:BROADCOM NVRAM DRIVER, Alexander Lobakin,
	Arnd Bergmann, Paul Cercueil, Xingxing Su,
	Linux Kernel Mailing List, zhaoxiao

On Thu, Nov 11, 2021 at 5:14 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Thu, Nov 11, 2021 at 04:55:35PM +0900, Masahiro Yamada wrote:
> > On Thu, Nov 11, 2021 at 3:52 AM Thomas Bogendoerfer
> > <tsbogend@alpha.franken.de> wrote:
> > >
> > > On Thu, Nov 11, 2021 at 02:02:32AM +0900, Masahiro Yamada wrote:
> > > > On Wed, Nov 10, 2021 at 5:56 PM Thomas Bogendoerfer
> > > > <tsbogend@alpha.franken.de> wrote:
> > > > >
> > > > > On Fri, Nov 05, 2021 at 11:38:14AM +0900, Masahiro Yamada wrote:
> > > > > > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > > > > > builds") stated, copying source files during the build time may not
> > > > > > end up with as clean code as expected.
> > > > > >
> > > > > > Do similar for mips to clean up the Makefile and .gitignore.
> > > > > >
> > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > > > > ---
> > > > > >
> > > > > >  arch/mips/boot/compressed/.gitignore   |  3 ---
> > > > > >  arch/mips/boot/compressed/Makefile     | 12 ------------
> > > > > >  arch/mips/boot/compressed/ashldi3.c    |  2 ++
> > > > > >  arch/mips/boot/compressed/bswapsi.c    |  2 ++
> > > > > >  arch/mips/boot/compressed/uart-ath79.c |  2 ++
> > > > > >  scripts/remove-stale-files             |  5 +++++
> > > > > >  6 files changed, 11 insertions(+), 15 deletions(-)
> > > > > >  delete mode 100644 arch/mips/boot/compressed/.gitignore
> > > > > >  create mode 100644 arch/mips/boot/compressed/ashldi3.c
> > > > > >  create mode 100644 arch/mips/boot/compressed/bswapsi.c
> > > > > >  create mode 100644 arch/mips/boot/compressed/uart-ath79.c
> > > > > >
> > > > > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> > > > > > deleted file mode 100644
> > > > > > index d358395614c9..000000000000
> > > > > > --- a/arch/mips/boot/compressed/.gitignore
> > > > > > +++ /dev/null
> > > > > > @@ -1,3 +0,0 @@
> > > > > > -# SPDX-License-Identifier: GPL-2.0-only
> > > > > > -ashldi3.c
> > > > > > -bswapsi.c
> > > > > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> > > > > > index 3548b3b45269..e6584dab2360 100644
> > > > > > --- a/arch/mips/boot/compressed/Makefile
> > > > > > +++ b/arch/mips/boot/compressed/Makefile
> > > > > > @@ -50,20 +50,8 @@ vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)            += $(obj)/uart-alchemy.o
> > > > > >  vmlinuzobjs-$(CONFIG_ATH79)                     += $(obj)/uart-ath79.o
> > > > > >  endif
> > > > > >
> > > > > > -extra-y += uart-ath79.c
> > > > > > -$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
> > > > > > -     $(call cmd,shipped)
> > > > > > -
> > > > > >  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
> > > > > >
> > > > > > -extra-y += ashldi3.c
> > > > > > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE
> > > > > > -     $(call if_changed,shipped)
> > > > > > -
> > > > > > -extra-y += bswapsi.c
> > > > > > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> > > > > > -     $(call if_changed,shipped)
> > > > > > -
> > > > > >  targets := $(notdir $(vmlinuzobjs-y))
> > > > > >
> > > > > >  targets += vmlinux.bin
> > > > > > diff --git a/arch/mips/boot/compressed/ashldi3.c b/arch/mips/boot/compressed/ashldi3.c
> > > > > > new file mode 100644
> > > > > > index 000000000000..f7bf6a7aae31
> > > > > > --- /dev/null
> > > > > > +++ b/arch/mips/boot/compressed/ashldi3.c
> > > > > > @@ -0,0 +1,2 @@
> > > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > > +#include "../../../../lib/ashldi3.c"
> > > > > > diff --git a/arch/mips/boot/compressed/bswapsi.c b/arch/mips/boot/compressed/bswapsi.c
> > > > > > new file mode 100644
> > > > > > index 000000000000..fdb9c6476904
> > > > > > --- /dev/null
> > > > > > +++ b/arch/mips/boot/compressed/bswapsi.c
> > > > > > @@ -0,0 +1,2 @@
> > > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > > +#include "../../lib/bswapsi.c"
> > > > > > diff --git a/arch/mips/boot/compressed/uart-ath79.c b/arch/mips/boot/compressed/uart-ath79.c
> > > > > > new file mode 100644
> > > > > > index 000000000000..d686820921be
> > > > > > --- /dev/null
> > > > > > +++ b/arch/mips/boot/compressed/uart-ath79.c
> > > > > > @@ -0,0 +1,2 @@
> > > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > > +#include "../../ath79/early_printk.c"
> > > > > > diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
> > > > > > index eb630ee287c3..c534fe1eac16 100755
> > > > > > --- a/scripts/remove-stale-files
> > > > > > +++ b/scripts/remove-stale-files
> > > > > > @@ -28,4 +28,9 @@ if [ -n "${building_out_of_srctree}" ]; then
> > > > > >       do
> > > > > >               rm -f arch/arm/boot/compressed/${f}
> > > > > >       done
> > > > > > +
> > > > > > +     for f in uart-ath79.c ashldi3.c bswapsi.c
> > > > > > +     do
> > > > > > +             rm -f arch/mips/boot/compressed/${f}
> > > > > > +     done
> > > > >
> > > > > hmm, isn't this the wrong action now that these files have been added
> > > > > to git ?
> > > > >
> > > > > Thomas.
> > > >
> > > >
> > > > Please note that the entire code block is enclosed by:
> > > >
> > > > if [ -n "${building_out_of_srctree}" ]; then
> > > >            ...
> > > > fi
> > > >
> > > >
> > > > "building_out_of_srctree" is set when you are doing
> > > > out-of-tree build  (O=<output-dir>).
> > > >
> > > > So, only the generated files are removed.
> > >
> > > but there aren't copied/generated any longer or I'm missing someting ?
> > >
> > > Anyway I've applied your patch to mips-next with changes to also cover
> > >
> > > https://patchwork.kernel.org/project/linux-mips/patch/20211110030944.6733-1-rdunlap@infradead.org/
> > >
> >
> >
> > Your conversion is wrong.
> >
> > The original code:
> >
> > $(obj)/bswapdi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE
> >         $(call if_changed,shipped)
> >
> >
> > copied mips-specific library code
> > (arch/mips/lib/bswapdi.c)
> >
> >
> > Now, you do
> >
> > #include "../../../../lib/ashldi3.c"
> >
> > , which wraps the generic library code
> > (lib/ashldi3.c)
>
> arch/mips/boot/compressed/bswapdi.c in my tree is
>
> diff --git a/arch/mips/boot/compressed/bswapdi.c b/arch/mips/boot/compressed/bswapdi.c
> new file mode 100644
> index 000000000000..acb28aebb025
> --- /dev/null
> +++ b/arch/mips/boot/compressed/bswapdi.c
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include "../../lib/bswapdi.c"
>
> which looks correct to me.
>
> Thomas.


My bad - I read the code wrongly.

Yes, the code is correct.

Sorry for that.




-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2021-11-11  8:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05  2:38 [PATCH] mips: decompressor: do not copy source files while building Masahiro Yamada
2021-11-09 12:10 ` Paul Cercueil
2021-11-09 16:57   ` Masahiro Yamada
2021-11-09 20:28     ` Paul Cercueil
2021-11-10  8:49 ` Thomas Bogendoerfer
2021-11-10 17:02   ` Masahiro Yamada
2021-11-10 18:52     ` Thomas Bogendoerfer
2021-11-11  2:58       ` Masahiro Yamada
2021-11-11  7:55       ` Masahiro Yamada
2021-11-11  8:14         ` Thomas Bogendoerfer
2021-11-11  8:24           ` 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).