linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text
@ 2022-01-13  8:19 Matthias Schiffer
  2022-01-13 17:09 ` Frank Rowand
  2022-01-14 15:26 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias Schiffer @ 2022-01-13  8:19 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: devicetree, linux-kernel, Matthias Schiffer

dtx_diff suggests to use <(...) syntax to pipe two inputs into it, but
this has never worked: The /proc/self/fds/... paths passed by the shell
will fail the `[ -f "${dtx}" ] && [ -r "${dtx}" ]` check in compile_to_dts,
but even with this check removed, the function cannot work: hexdump will
eat up the DTB magic, making the subsequent dtc call fail, as a pipe
cannot be rewound.

Simply remove this broken example, as there is already an alternative one
that works fine.

Fixes: 10eadc253ddf ("dtc: create tool to diff device trees")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
 scripts/dtc/dtx_diff | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff
index d3422ee15e30..f2bbde4bba86 100755
--- a/scripts/dtc/dtx_diff
+++ b/scripts/dtc/dtx_diff
@@ -59,12 +59,8 @@ Otherwise DTx is treated as a dts source file (aka .dts).
    or '/include/' to be processed.
 
    If DTx_1 and DTx_2 are in different architectures, then this script
-   may not work since \${ARCH} is part of the include path.  Two possible
-   workarounds:
-
-      `basename $0` \\
-          <(ARCH=arch_of_dtx_1 `basename $0` DTx_1) \\
-          <(ARCH=arch_of_dtx_2 `basename $0` DTx_2)
+   may not work since \${ARCH} is part of the include path.  The following
+   workaround can be used:
 
       `basename $0` ARCH=arch_of_dtx_1 DTx_1 >tmp_dtx_1.dts
       `basename $0` ARCH=arch_of_dtx_2 DTx_2 >tmp_dtx_2.dts
-- 
2.25.1


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

* Re: [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text
  2022-01-13  8:19 [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text Matthias Schiffer
@ 2022-01-13 17:09 ` Frank Rowand
  2022-01-14 15:26 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2022-01-13 17:09 UTC (permalink / raw)
  To: Matthias Schiffer, Rob Herring; +Cc: devicetree, linux-kernel

On 1/13/22 2:19 AM, Matthias Schiffer wrote:
> dtx_diff suggests to use <(...) syntax to pipe two inputs into it, but
> this has never worked: The /proc/self/fds/... paths passed by the shell
> will fail the `[ -f "${dtx}" ] && [ -r "${dtx}" ]` check in compile_to_dts,
> but even with this check removed, the function cannot work: hexdump will
> eat up the DTB magic, making the subsequent dtc call fail, as a pipe
> cannot be rewound.
> 
> Simply remove this broken example, as there is already an alternative one
> that works fine.
> 
> Fixes: 10eadc253ddf ("dtc: create tool to diff device trees")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
>  scripts/dtc/dtx_diff | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff
> index d3422ee15e30..f2bbde4bba86 100755
> --- a/scripts/dtc/dtx_diff
> +++ b/scripts/dtc/dtx_diff
> @@ -59,12 +59,8 @@ Otherwise DTx is treated as a dts source file (aka .dts).
>     or '/include/' to be processed.
>  
>     If DTx_1 and DTx_2 are in different architectures, then this script
> -   may not work since \${ARCH} is part of the include path.  Two possible
> -   workarounds:
> -
> -      `basename $0` \\
> -          <(ARCH=arch_of_dtx_1 `basename $0` DTx_1) \\
> -          <(ARCH=arch_of_dtx_2 `basename $0` DTx_2)
> +   may not work since \${ARCH} is part of the include path.  The following
> +   workaround can be used:
>  
>        `basename $0` ARCH=arch_of_dtx_1 DTx_1 >tmp_dtx_1.dts
>        `basename $0` ARCH=arch_of_dtx_2 DTx_2 >tmp_dtx_2.dts
>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>

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

* Re: [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text
  2022-01-13  8:19 [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text Matthias Schiffer
  2022-01-13 17:09 ` Frank Rowand
@ 2022-01-14 15:26 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2022-01-14 15:26 UTC (permalink / raw)
  To: Matthias Schiffer; +Cc: Frank Rowand, devicetree, linux-kernel

On Thu, Jan 13, 2022 at 09:19:18AM +0100, Matthias Schiffer wrote:
> dtx_diff suggests to use <(...) syntax to pipe two inputs into it, but
> this has never worked: The /proc/self/fds/... paths passed by the shell
> will fail the `[ -f "${dtx}" ] && [ -r "${dtx}" ]` check in compile_to_dts,
> but even with this check removed, the function cannot work: hexdump will
> eat up the DTB magic, making the subsequent dtc call fail, as a pipe
> cannot be rewound.
> 
> Simply remove this broken example, as there is already an alternative one
> that works fine.
> 
> Fixes: 10eadc253ddf ("dtc: create tool to diff device trees")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
>  scripts/dtc/dtx_diff | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Applied, thanks.

Rob

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

end of thread, other threads:[~2022-01-14 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  8:19 [PATCH v2] scripts/dtc: dtx_diff: remove broken example from help text Matthias Schiffer
2022-01-13 17:09 ` Frank Rowand
2022-01-14 15:26 ` Rob Herring

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