mach-k3: common_fdt: Move carveout struct
Subsystems (2)
PATCH v3 1/1 mach-k3: common_fdt: Move carveout struct
Labels are not allowed before declarations. Move the carveout struct at the beginning and only update 'end' at this point.
This will fix following error:
arch/arm/mach-k3/common_fdt.c: In function 'fdt_fixup_reserved':arch/arm/mach-k3/common_fdt.c:156:2: error: a label can only be part of a statement and a declaration is not a statement
156 | struct fdt_memory carveout = {
| ^~~~~~make[1]: *** [scripts/Makefile.build:256: arch/arm/mach-k3/common_fdt.o] Error 1
make: *** [Makefile:1919: arch/arm/mach-k3] Error 2
---
Changes in v2:
* Moved carveout struct at the beginning instead of adding an dummy statement.
Changes in v3:
* Removed .end assignment from carveout definition.
arch/arm/mach-k3/common_fdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-k3/common_fdt.c +4 -4
@@ -119,6 +119,9 @@ int fdt_fixup_reserved(void *blob, const char *name, {int nodeoffset, subnode;int ret; +struct fdt_memory carveout = { + .start = new_address, + };/* Find reserved-memory */ nodeoffset =fdt_subnode_offset (blob,0 ,"reserved-memory" );
@@ -153,10 +156,7 @@ int fdt_fixup_reserved(void *blob, const char *name, } add_carveout: -struct fdt_memory carveout = { - .start = new_address, - .end = new_address + new_size -1 , - }; + carveout.end = new_address + new_size -1 ; ret =fdtdec_add_reserved_memory (blob, name, &carveout,NULL ,0 ,NULL ,FDTDEC_RESERVED_MEMORY_NO_MAP );if (ret <0 )
Signature · 1 line
2.25.1
On April 15, 2025 thus sayeth Daniel Schultz:
Quoted 14 lines
Labels are not allowed before declarations. Move the carveout struct at the beginning and only update 'end' at this point.
This will fix following error:
arch/arm/mach-k3/common_fdt.c: In function 'fdt_fixup_reserved':arch/arm/mach-k3/common_fdt.c:156:2: error: a label can only be part of a statement and a declaration is not a statement156 | struct fdt_memory carveout = { | ^~~~~~make[1]: *** [
scripts/Makefile.build:256:arch/arm/mach-k3/common_fdt.o] Error 1
make: *** [Makefile:1919:arch/arm/mach-k3] Error 2Fixes 096aa229a9e ("mach-k3: common_fdt: create a reserved memory node")
Quoted 9 lines
Signed-off-by Daniel Schultz <[email protected]>Reviewed-by Udit Kumar <[email protected]>---
Changes in v2:
* Moved carveout struct at the beginning instead of adding an dummy statement.Changes in v3:
* Removed .end assignment from carveout definition.
Thanks again for fixing this up
~Bryan
Quoted 5 lines · Daniel Schultz
Labels are not allowed before declarations. Move the carveout struct at the beginning and only update 'end' at this point.
This will fix following error:
Quoted 8 lines
arch/arm/mach-k3/common_fdt.c: In function 'fdt_fixup_reserved':arch/arm/mach-k3/common_fdt.c:156:2: error: a label can only be part of a statement and a declaration is not a statement156 | struct fdt_memory carveout = { | ^~~~~~make[1]: *** [
scripts/Makefile.build:256:arch/arm/mach-k3/common_fdt.o] Error 1
make: *** [Makefile:1919:arch/arm/mach-k3] Error 2[...]
Applied to u-boot/master, thanks!
[1/1] mach-k3: common_fdt: Move carveout struct
commit: 4b1b07e3c6055edd29b98a7a30a5c7d062395df7
Signature · 1 line
Tom