All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: Do not call useless command 'true'
@ 2020-11-04 14:33 Pali Rohár
  2021-01-16  0:21 ` Pali Rohár
  2021-01-28 23:56 ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Pali Rohár @ 2020-11-04 14:33 UTC (permalink / raw)
  To: u-boot

Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
in 'cmd_static_rela' to workaround this issue.

Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
empty 'cmd_static_rela' macro and remove useless invocation of command
'true'.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index b90fe8b865..aeb2c17a9b 100644
--- a/Makefile
+++ b/Makefile
@@ -885,7 +885,7 @@ cmd_static_rela = \
 	tools/relocate-rela $(3) $(4) $$start $$end
 else
 quiet_cmd_static_rela =
-cmd_static_rela = true
+cmd_static_rela =
 endif
 
 # Always append INPUTS so that arch config.mk's can add custom ones
@@ -1312,7 +1312,11 @@ endif
 shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
 
 quiet_cmd_objcopy_uboot = OBJCOPY $@
+ifdef cmd_static_rela
 cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
+else
+cmd_objcopy_uboot = $(cmd_objcopy)
+endif
 
 u-boot-nodtb.bin: u-boot FORCE
 	$(call if_changed,objcopy_uboot)
-- 
2.20.1

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

* [PATCH] Makefile: Do not call useless command 'true'
  2020-11-04 14:33 [PATCH] Makefile: Do not call useless command 'true' Pali Rohár
@ 2021-01-16  0:21 ` Pali Rohár
  2021-01-19 18:06   ` Simon Glass
  2021-01-28 23:56 ` Tom Rini
  1 sibling, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2021-01-16  0:21 UTC (permalink / raw)
  To: u-boot

Hello! Could you please review this patch?

On Wednesday 04 November 2020 15:33:44 Pali Roh?r wrote:
> Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
> expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
> in 'cmd_static_rela' to workaround this issue.
> 
> Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
> empty 'cmd_static_rela' macro and remove useless invocation of command
> 'true'.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index b90fe8b865..aeb2c17a9b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -885,7 +885,7 @@ cmd_static_rela = \
>  	tools/relocate-rela $(3) $(4) $$start $$end
>  else
>  quiet_cmd_static_rela =
> -cmd_static_rela = true
> +cmd_static_rela =
>  endif
>  
>  # Always append INPUTS so that arch config.mk's can add custom ones
> @@ -1312,7 +1312,11 @@ endif
>  shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
>  
>  quiet_cmd_objcopy_uboot = OBJCOPY $@
> +ifdef cmd_static_rela
>  cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
> +else
> +cmd_objcopy_uboot = $(cmd_objcopy)
> +endif
>  
>  u-boot-nodtb.bin: u-boot FORCE
>  	$(call if_changed,objcopy_uboot)
> -- 
> 2.20.1
> 

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

* [PATCH] Makefile: Do not call useless command 'true'
  2021-01-16  0:21 ` Pali Rohár
@ 2021-01-19 18:06   ` Simon Glass
  2021-01-19 18:39     ` Pali Rohár
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2021-01-19 18:06 UTC (permalink / raw)
  To: u-boot

Hi Pali,

On Fri, 15 Jan 2021 at 17:21, Pali Roh?r <pali@kernel.org> wrote:
>
> Hello! Could you please review this patch?
>
> On Wednesday 04 November 2020 15:33:44 Pali Roh?r wrote:
> > Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
> > expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
> > in 'cmd_static_rela' to workaround this issue.
> >
> > Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
> > empty 'cmd_static_rela' macro and remove useless invocation of command
> > 'true'.
> >
> > Signed-off-by: Pali Roh?r <pali@kernel.org>
> > ---
> >  Makefile | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index b90fe8b865..aeb2c17a9b 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -885,7 +885,7 @@ cmd_static_rela = \
> >       tools/relocate-rela $(3) $(4) $$start $$end
> >  else
> >  quiet_cmd_static_rela =
> > -cmd_static_rela = true
> > +cmd_static_rela =
> >  endif
> >
> >  # Always append INPUTS so that arch config.mk's can add custom ones
> > @@ -1312,7 +1312,11 @@ endif
> >  shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
> >
> >  quiet_cmd_objcopy_uboot = OBJCOPY $@
> > +ifdef cmd_static_rela
> >  cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
> > +else
> > +cmd_objcopy_uboot = $(cmd_objcopy)
> > +endif
> >
> >  u-boot-nodtb.bin: u-boot FORCE
> >       $(call if_changed,objcopy_uboot)
> > --
> > 2.20.1
> >

I don't know much about that and your patch looks reasonable, but what
is the motivation? Is it a code clean-up or a bug?

Regards,
Simon

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

* [PATCH] Makefile: Do not call useless command 'true'
  2021-01-19 18:06   ` Simon Glass
@ 2021-01-19 18:39     ` Pali Rohár
  2021-01-20  0:19       ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2021-01-19 18:39 UTC (permalink / raw)
  To: u-boot

On Tuesday 19 January 2021 11:06:12 Simon Glass wrote:
> Hi Pali,
> 
> On Fri, 15 Jan 2021 at 17:21, Pali Roh?r <pali@kernel.org> wrote:
> >
> > Hello! Could you please review this patch?
> >
> > On Wednesday 04 November 2020 15:33:44 Pali Roh?r wrote:
> > > Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
> > > expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
> > > in 'cmd_static_rela' to workaround this issue.
> > >
> > > Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
> > > empty 'cmd_static_rela' macro and remove useless invocation of command
> > > 'true'.
> > >
> > > Signed-off-by: Pali Roh?r <pali@kernel.org>
> > > ---
> > >  Makefile | 6 +++++-
> > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index b90fe8b865..aeb2c17a9b 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -885,7 +885,7 @@ cmd_static_rela = \
> > >       tools/relocate-rela $(3) $(4) $$start $$end
> > >  else
> > >  quiet_cmd_static_rela =
> > > -cmd_static_rela = true
> > > +cmd_static_rela =
> > >  endif
> > >
> > >  # Always append INPUTS so that arch config.mk's can add custom ones
> > > @@ -1312,7 +1312,11 @@ endif
> > >  shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
> > >
> > >  quiet_cmd_objcopy_uboot = OBJCOPY $@
> > > +ifdef cmd_static_rela
> > >  cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
> > > +else
> > > +cmd_objcopy_uboot = $(cmd_objcopy)
> > > +endif
> > >
> > >  u-boot-nodtb.bin: u-boot FORCE
> > >       $(call if_changed,objcopy_uboot)
> > > --
> > > 2.20.1
> > >
> 
> I don't know much about that and your patch looks reasonable, but what
> is the motivation? Is it a code clean-up or a bug?

Hello! I do not know about any bugs here, so it is just code clean-up.

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

* [PATCH] Makefile: Do not call useless command 'true'
  2021-01-19 18:39     ` Pali Rohár
@ 2021-01-20  0:19       ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2021-01-20  0:19 UTC (permalink / raw)
  To: u-boot

On Tue, 19 Jan 2021 at 11:39, Pali Roh?r <pali@kernel.org> wrote:
>
> On Tuesday 19 January 2021 11:06:12 Simon Glass wrote:
> > Hi Pali,
> >
> > On Fri, 15 Jan 2021 at 17:21, Pali Roh?r <pali@kernel.org> wrote:
> > >
> > > Hello! Could you please review this patch?
> > >
> > > On Wednesday 04 November 2020 15:33:44 Pali Roh?r wrote:
> > > > Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
> > > > expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
> > > > in 'cmd_static_rela' to workaround this issue.
> > > >
> > > > Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
> > > > empty 'cmd_static_rela' macro and remove useless invocation of command
> > > > 'true'.
> > > >
> > > > Signed-off-by: Pali Roh?r <pali@kernel.org>
> > > > ---
> > > >  Makefile | 6 +++++-
> > > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/Makefile b/Makefile
> > > > index b90fe8b865..aeb2c17a9b 100644
> > > > --- a/Makefile
> > > > +++ b/Makefile
> > > > @@ -885,7 +885,7 @@ cmd_static_rela = \
> > > >       tools/relocate-rela $(3) $(4) $$start $$end
> > > >  else
> > > >  quiet_cmd_static_rela =
> > > > -cmd_static_rela = true
> > > > +cmd_static_rela =
> > > >  endif
> > > >
> > > >  # Always append INPUTS so that arch config.mk's can add custom ones
> > > > @@ -1312,7 +1312,11 @@ endif
> > > >  shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
> > > >
> > > >  quiet_cmd_objcopy_uboot = OBJCOPY $@
> > > > +ifdef cmd_static_rela
> > > >  cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
> > > > +else
> > > > +cmd_objcopy_uboot = $(cmd_objcopy)
> > > > +endif
> > > >
> > > >  u-boot-nodtb.bin: u-boot FORCE
> > > >       $(call if_changed,objcopy_uboot)
> > > > --
> > > > 2.20.1
> > > >
> >
> > I don't know much about that and your patch looks reasonable, but what
> > is the motivation? Is it a code clean-up or a bug?
>
> Hello! I do not know about any bugs here, so it is just code clean-up.

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [PATCH] Makefile: Do not call useless command 'true'
  2020-11-04 14:33 [PATCH] Makefile: Do not call useless command 'true' Pali Rohár
  2021-01-16  0:21 ` Pali Rohár
@ 2021-01-28 23:56 ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2021-01-28 23:56 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 04, 2020 at 03:33:44PM +0100, Pali Roh?r wrote:

> Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
> expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
> in 'cmd_static_rela' to workaround this issue.
> 
> Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
> empty 'cmd_static_rela' macro and remove useless invocation of command
> 'true'.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>  Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index b90fe8b865..aeb2c17a9b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -885,7 +885,7 @@ cmd_static_rela = \
>  	tools/relocate-rela $(3) $(4) $$start $$end
>  else
>  quiet_cmd_static_rela =
> -cmd_static_rela = true
> +cmd_static_rela =
>  endif
>  
>  # Always append INPUTS so that arch config.mk's can add custom ones
> @@ -1312,7 +1312,11 @@ endif
>  shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
>  
>  quiet_cmd_objcopy_uboot = OBJCOPY $@
> +ifdef cmd_static_rela
>  cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; }
> +else
> +cmd_objcopy_uboot = $(cmd_objcopy)
> +endif
>  
>  u-boot-nodtb.bin: u-boot FORCE
>  	$(call if_changed,objcopy_uboot)

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/cbabbcf9/attachment.sig>

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

end of thread, other threads:[~2021-01-28 23:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 14:33 [PATCH] Makefile: Do not call useless command 'true' Pali Rohár
2021-01-16  0:21 ` Pali Rohár
2021-01-19 18:06   ` Simon Glass
2021-01-19 18:39     ` Pali Rohár
2021-01-20  0:19       ` Simon Glass
2021-01-28 23:56 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.