projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1823ed
)
fdtgrep: Simplify code to inverting the match
author
Simon Glass
<sjg@chromium.org>
Sun, 17 Dec 2023 16:36:19 +0000
(09:36 -0700)
committer
Simon Glass
<sjg@chromium.org>
Sun, 31 Dec 2023 14:21:02 +0000
(07:21 -0700)
The code to invert the match in h_include() is a bit convoluted.
Simplify it by using disp->invert only once.
Signed-off-by: Simon Glass <sjg@chromium.org>
tools/fdtgrep.c
patch
|
blob
|
history
diff --git
a/tools/fdtgrep.c
b/tools/fdtgrep.c
index a6cdc326709d0fa74ae9e9969d56548352513eff..b06a1a7a838439255af9486500e48417c4cf9b91 100644
(file)
--- a/
tools/fdtgrep.c
+++ b/
tools/fdtgrep.c
@@
-634,14
+634,8
@@
static int h_include(void *priv, const void *fdt, int offset, int type,
inc = 0;
}
- switch (inc) {
- case 1:
- inc = !disp->invert;
- break;
- case 0:
- inc = disp->invert;
- break;
- }
+ if (inc != -1 && disp->invert)
+ inc = !inc;
debug(" - returning %d\n", inc);
return inc;