diff mbox

[v2,1/3] board_qemu: drop unused values early in fdt-fix-node-phandle

Message ID 149998471438.13629.17597725105451052140.stgit@bahia.lan
State Superseded
Headers show

Commit Message

Greg Kurz July 13, 2017, 10:25 p.m. UTC
These two values are pushed on the stack by decode-int and stay unused
until the 2drop line. Let's drop them right away to make it obvious.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 board-qemu/slof/fdt.fs |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Segher Boessenkool July 13, 2017, 11:03 p.m. UTC | #1
On Fri, Jul 14, 2017 at 12:25:14AM +0200, Greg Kurz wrote:
> These two values are pushed on the stack by decode-int and stay unused
> until the 2drop line. Let's drop them right away to make it obvious.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  board-qemu/slof/fdt.fs |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
> index 8d4635f30495..eff3375c5916 100644
> --- a/board-qemu/slof/fdt.fs
> +++ b/board-qemu/slof/fdt.fs
> @@ -314,11 +314,10 @@ fdt-claim-reserve
>     >r
>     FALSE TO (fdt-phandle-replaced)
>     s" phandle" r@ get-property 0= IF
> -      decode-int                       ( p-addr2 p-len2 val )
> +      decode-int -rot 2drop

decode-int nip nip   may be a tiny bit clearer (and faster).  But,
looks good anyway :-)


Segher


>        \ ." found phandle: " dup . cr
> -      r@ s" /" find-node               ( p-addr2 p-len2 val node root )  
> -      fdt-replace-all-phandles         ( p-addr2 p-len2 )
> -      2drop
> +      r@ s" /" find-node               ( val node root )
> +      fdt-replace-all-phandles
>        (fdt-phandle-replaced) IF
>           r@ set-node
>           s" phandle" delete-property
diff mbox

Patch

diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index 8d4635f30495..eff3375c5916 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -314,11 +314,10 @@  fdt-claim-reserve
    >r
    FALSE TO (fdt-phandle-replaced)
    s" phandle" r@ get-property 0= IF
-      decode-int                       ( p-addr2 p-len2 val )
+      decode-int -rot 2drop
       \ ." found phandle: " dup . cr
-      r@ s" /" find-node               ( p-addr2 p-len2 val node root )  
-      fdt-replace-all-phandles         ( p-addr2 p-len2 )
-      2drop
+      r@ s" /" find-node               ( val node root )
+      fdt-replace-all-phandles
       (fdt-phandle-replaced) IF
          r@ set-node
          s" phandle" delete-property