tools: fdtgrep: Use unsigned chars for arrays
PATCH 1/1 tools: fdtgrep: Use unsigned chars for arrays
Otherwise, values over 127 end up prefixed with ffffff.
Signed-off-by Samuel Dionne-Riel <[email protected]>
Cc Simon Glass <[email protected]>
---
Minimal reproduction:
```
// repro.dts
/dts-v1/;
/ {
ra = [ 7f ];
rb = [ 80 ];
};
```Steps used to compile:
$ dtc repro.dts > repro.dtb
Without the fix:
$ fdtgrep --include-node / repro.dtb
/ {
ra = [7f];
rb = [ffffff80];
};With the fix:
$ fdtgrep --include-node / repro.dtb
/ {
ra = [7f];
rb = [80];
};---
tools/fdtgrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fdtgrep.c +1 -1
@@ -213,7 +213,7 @@ static void utilfdt_print_data(const char *data, int len) }else {printf (" = [" );for (i =0 ; i < len; i++) -printf ("%02x%s" , *p++, i < len -1 ?" " :"" ); +printf ("%02x%s" , (unsigned char )*p++, i < len -1 ?" " :"" );printf ("]" ); } }
Signature · 1 line
2.29.2
PATCH 1/1 tools: fdtgrep: Use unsigned chars for arrays
Quoted 39 lines · Samuel Dionne-Riel
Otherwise, values over 127 end up prefixed with ffffff.
Signed-off-by Samuel Dionne-Riel <[email protected]>Cc Simon Glass <[email protected]>---
Minimal reproduction:
``` // repro.dts /dts-v1/; / { ra = [ 7f ]; rb = [ 80 ]; }; ```Steps used to compile:
$ dtc repro.dts > repro.dtbWithout the fix:
$ fdtgrep --include-node / repro.dtb / { ra = [7f]; rb = [ffffff80]; };With the fix:
$ fdtgrep --include-node / repro.dtb / { ra = [7f]; rb = [80]; };
Quoted 4 lines
---
tools/fdtgrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 tools: fdtgrep: Use unsigned chars for arrays
Quoted 39 lines · Samuel Dionne-Riel
Otherwise, values over 127 end up prefixed with ffffff.
Signed-off-by Samuel Dionne-Riel <[email protected]>Cc Simon Glass <[email protected]>---
Minimal reproduction:
``` // repro.dts /dts-v1/; / { ra = [ 7f ]; rb = [ 80 ]; }; ```Steps used to compile:
$ dtc repro.dts > repro.dtbWithout the fix:
$ fdtgrep --include-node / repro.dtb / { ra = [7f]; rb = [ffffff80]; };With the fix:
$ fdtgrep --include-node / repro.dtb / { ra = [7f]; rb = [80]; };
Quoted 4 lines
---
tools/fdtgrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Simon Glass <[email protected]>
Applied to u-boot-dm/next, thanks!