mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usr: shorten cmd_initfs in Makefile
@ 2024-05-31 12:28 Masahiro Yamada
  2024-06-03 22:24 ` Nathan Chancellor
  2024-07-16  8:52 ` Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-05-31 12:28 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor, Nicolas Schier

Avoid repetition of long variables.

No functional change intended.

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

 usr/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr/Makefile b/usr/Makefile
index 132ef7e96e6d..75224d927025 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -62,9 +62,9 @@ $(deps_initramfs): ;
 quiet_cmd_initfs = GEN     $@
       cmd_initfs = \
 	$(CONFIG_SHELL) $< -o $@ -l $(obj)/.initramfs_data.cpio.d \
-	$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
-	$(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
-	$(if $(KBUILD_BUILD_TIMESTAMP), -d "$(KBUILD_BUILD_TIMESTAMP)") \
+	$(addprefix -u , $(CONFIG_INITRAMFS_ROOT_UID)) \
+	$(addprefix -g , $(CONFIG_INITRAMFS_ROOT_GID)) \
+	$(patsubst %,-d "%", $(KBUILD_BUILD_TIMESTAMP)) \
 	$(ramfs-input)
 
 # We rebuild initramfs_data.cpio if:
-- 
2.40.1


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

* Re: [PATCH] usr: shorten cmd_initfs in Makefile
  2024-05-31 12:28 [PATCH] usr: shorten cmd_initfs in Makefile Masahiro Yamada
@ 2024-06-03 22:24 ` Nathan Chancellor
  2024-07-16  8:52 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2024-06-03 22:24 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel, Nicolas Schier

On Fri, May 31, 2024 at 09:28:25PM +0900, Masahiro Yamada wrote:
> Avoid repetition of long variables.
> 
> No functional change intended.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
>  usr/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/usr/Makefile b/usr/Makefile
> index 132ef7e96e6d..75224d927025 100644
> --- a/usr/Makefile
> +++ b/usr/Makefile
> @@ -62,9 +62,9 @@ $(deps_initramfs): ;
>  quiet_cmd_initfs = GEN     $@
>        cmd_initfs = \
>  	$(CONFIG_SHELL) $< -o $@ -l $(obj)/.initramfs_data.cpio.d \
> -	$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
> -	$(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
> -	$(if $(KBUILD_BUILD_TIMESTAMP), -d "$(KBUILD_BUILD_TIMESTAMP)") \
> +	$(addprefix -u , $(CONFIG_INITRAMFS_ROOT_UID)) \
> +	$(addprefix -g , $(CONFIG_INITRAMFS_ROOT_GID)) \
> +	$(patsubst %,-d "%", $(KBUILD_BUILD_TIMESTAMP)) \
>  	$(ramfs-input)
>  
>  # We rebuild initramfs_data.cpio if:
> -- 
> 2.40.1
> 

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

* Re: [PATCH] usr: shorten cmd_initfs in Makefile
  2024-05-31 12:28 [PATCH] usr: shorten cmd_initfs in Makefile Masahiro Yamada
  2024-06-03 22:24 ` Nathan Chancellor
@ 2024-07-16  8:52 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-07-16  8:52 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Nathan Chancellor, Nicolas Schier

On Fri, May 31, 2024 at 9:28 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Avoid repetition of long variables.
>
> No functional change intended.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  usr/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/usr/Makefile b/usr/Makefile
> index 132ef7e96e6d..75224d927025 100644
> --- a/usr/Makefile
> +++ b/usr/Makefile
> @@ -62,9 +62,9 @@ $(deps_initramfs): ;
>  quiet_cmd_initfs = GEN     $@
>        cmd_initfs = \
>         $(CONFIG_SHELL) $< -o $@ -l $(obj)/.initramfs_data.cpio.d \
> -       $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
> -       $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
> -       $(if $(KBUILD_BUILD_TIMESTAMP), -d "$(KBUILD_BUILD_TIMESTAMP)") \
> +       $(addprefix -u , $(CONFIG_INITRAMFS_ROOT_UID)) \
> +       $(addprefix -g , $(CONFIG_INITRAMFS_ROOT_GID)) \
> +       $(patsubst %,-d "%", $(KBUILD_BUILD_TIMESTAMP)) \


I dropped the last line because it will not work
when $(KBUILD_BUILD_TIMESTAMP) contains a space.





>         $(ramfs-input)
>
>  # We rebuild initramfs_data.cpio if:
> --
> 2.40.1
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2024-07-16  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-31 12:28 [PATCH] usr: shorten cmd_initfs in Makefile Masahiro Yamada
2024-06-03 22:24 ` Nathan Chancellor
2024-07-16  8:52 ` Masahiro Yamada

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

all inboxes | Powered by JetHome®