public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets
@ 2018-07-25  5:16 Masahiro Yamada
  2018-07-25  5:16 ` [PATCH 2/2] kbuild: do not redirect the first prerequisite for filechk Masahiro Yamada
  2018-07-25 10:17 ` [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-07-25  5:16 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Masahiro Yamada, Nicolas Ferre, Alexandre Belloni,
	Russell King, linux-arm-kernel, linux-kernel

The filechk_offsets in arch/arm/mach-at91/Makefile is never
used because it is always overridden by the equivalent one in
scripts/Makefile.lib

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

I will queue this to my kbuild tree.


 arch/arm/mach-at91/Makefile | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 4ea93c9..7415f18 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,31 +19,6 @@ ifeq ($(CONFIG_PM_DEBUG),y)
 CFLAGS_pm.o += -DDEBUG
 endif
 
-# Default sed regexp - multiline due to syntax constraints
-define sed-y
-	"/^->/{s:->#\(.*\):/* \1 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:->::; p;}"
-endef
-
-# Use filechk to avoid rebuilds when a header changes, but the resulting file
-# does not
-define filechk_offsets
-	(set -e; \
-	 echo "#ifndef $2"; \
-	 echo "#define $2"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by Kbuild"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne $(sed-y); \
-	 echo ""; \
-	 echo "#endif" )
-endef
-
 arch/arm/mach-at91/pm_data-offsets.s: arch/arm/mach-at91/pm_data-offsets.c
 	$(call if_changed_dep,cc_s_c)
 
-- 
2.7.4


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

* [PATCH 2/2] kbuild: do not redirect the first prerequisite for filechk
  2018-07-25  5:16 [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Masahiro Yamada
@ 2018-07-25  5:16 ` Masahiro Yamada
  2018-07-25 10:17 ` [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-07-25  5:16 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Masahiro Yamada, linux-s390, Heiko Carstens,
	linux-um, linux-kernel, Michal Marek, Richard Weinberger,
	Martin Schwidefsky, Jeff Dike, Hendrik Brueckner

Currently, filechk unconditionally opens the first prerequisite and
redirects it as the stdin of a filechk_* rule.  Hence, every target
using $(call filechk,...) must list something as the first prerequisite
even if it is unneeded.

'< $<' is actually unneeded in most cases.  Each rule can explicitly
adds it if necessary.

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

 Makefile                           | 2 +-
 arch/s390/kernel/syscalls/Makefile | 6 +++---
 arch/um/Makefile                   | 2 +-
 scripts/Kbuild.include             | 2 +-
 scripts/Makefile.lib               | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 67d9d20..af863f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1116,7 +1116,7 @@ define filechk_version.h
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-$(version_h): $(srctree)/Makefile FORCE
+$(version_h): FORCE
 	$(call filechk,version.h)
 	$(Q)rm -f $(old_version_h)
 
diff --git a/arch/s390/kernel/syscalls/Makefile b/arch/s390/kernel/syscalls/Makefile
index 8ff96c0..4d929ed 100644
--- a/arch/s390/kernel/syscalls/Makefile
+++ b/arch/s390/kernel/syscalls/Makefile
@@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
 	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
 define filechk_syshdr
-	$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2"
+	$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
 endef
 
 define filechk_sysnr
-	$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget))
+	$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
 endef
 
 define filechk_syscalls
-	$(CONFIG_SHELL) '$(systbl)' -S
+	$(CONFIG_SHELL) '$(systbl)' -S < $<
 endef
 
 syshdr_abi_unistd_32 := common,32
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..8c35261 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -169,7 +169,7 @@ define filechk_gen-asm-offsets
          echo " *"; \
          echo " */"; \
          echo ""; \
-         sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+         sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \
          echo ""; )
 endef
 
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 86321f0..0bee89c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho)
 define filechk
 	$(Q)set -e;				\
 	mkdir -p $(dir $@);			\
-	$(filechk_$(1)) < $< > $@.tmp;		\
+	$(filechk_$(1)) > $@.tmp;		\
 	if [ -r $@ ] && cmp -s $@ $@.tmp; then	\
 		rm -f $@.tmp;			\
 	else					\
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..4b2f89f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -416,7 +416,7 @@ define filechk_offsets
 	 echo " * This file was generated by Kbuild"; \
 	 echo " */"; \
 	 echo ""; \
-	 sed -ne $(sed-offsets); \
+	 sed -ne $(sed-offsets) < $<; \
 	 echo ""; \
 	 echo "#endif" )
 endef
-- 
2.7.4


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

* Re: [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets
  2018-07-25  5:16 [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Masahiro Yamada
  2018-07-25  5:16 ` [PATCH 2/2] kbuild: do not redirect the first prerequisite for filechk Masahiro Yamada
@ 2018-07-25 10:17 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-07-25 10:17 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Sam Ravnborg, Nicolas Ferre, Russell King,
	linux-arm-kernel, linux-kernel

On 25/07/2018 14:16:10+0900, Masahiro Yamada wrote:
> The filechk_offsets in arch/arm/mach-at91/Makefile is never
> used because it is always overridden by the equivalent one in
> scripts/Makefile.lib
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
> 
> I will queue this to my kbuild tree.
> 
> 
>  arch/arm/mach-at91/Makefile | 25 -------------------------
>  1 file changed, 25 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 4ea93c9..7415f18 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -19,31 +19,6 @@ ifeq ($(CONFIG_PM_DEBUG),y)
>  CFLAGS_pm.o += -DDEBUG
>  endif
>  
> -# Default sed regexp - multiline due to syntax constraints
> -define sed-y
> -	"/^->/{s:->#\(.*\):/* \1 */:; \
> -	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
> -	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
> -	s:->::; p;}"
> -endef
> -
> -# Use filechk to avoid rebuilds when a header changes, but the resulting file
> -# does not
> -define filechk_offsets
> -	(set -e; \
> -	 echo "#ifndef $2"; \
> -	 echo "#define $2"; \
> -	 echo "/*"; \
> -	 echo " * DO NOT MODIFY."; \
> -	 echo " *"; \
> -	 echo " * This file was generated by Kbuild"; \
> -	 echo " */"; \
> -	 echo ""; \
> -	 sed -ne $(sed-y); \
> -	 echo ""; \
> -	 echo "#endif" )
> -endef
> -
>  arch/arm/mach-at91/pm_data-offsets.s: arch/arm/mach-at91/pm_data-offsets.c
>  	$(call if_changed_dep,cc_s_c)
>  
> -- 
> 2.7.4
> 

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-07-25 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25  5:16 [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Masahiro Yamada
2018-07-25  5:16 ` [PATCH 2/2] kbuild: do not redirect the first prerequisite for filechk Masahiro Yamada
2018-07-25 10:17 ` [PATCH 1/2] ARM: at91: remove unused duplicated filechk_offsets Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox