U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schultz <d.schultz@phytec.de>
To: <trini@konsulko.com>, <u-kumar1@ti.com>, <bb@ti.com>,
	<afd@ti.com>, <n-francis@ti.com>, <u-boot@lists.denx.de>
Cc: <w.egorov@phytec.de>, <upstream@lists.phytec.de>,
	Daniel Schultz <d.schultz@phytec.de>
Subject: [PATCH v3] mach-k3: common_fdt: Move carveout struct
Date: Tue, 15 Apr 2025 08:12:41 -0700	[thread overview]
Message-ID: <20250415151241.3128391-1-d.schultz@phytec.de> (raw)

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

Fixes: 096aa229a9e ("mach-k3: common_fdt: create a reserved memory node")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
---
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(-)

diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
index 361b0c0b31b..867ed173142 100644
--- a/arch/arm/mach-k3/common_fdt.c
+++ b/arch/arm/mach-k3/common_fdt.c
@@ -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)
-- 
2.25.1


             reply	other threads:[~2025-04-15 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 15:12 Daniel Schultz [this message]
2025-04-16 14:45 ` [PATCH v3] mach-k3: common_fdt: Move carveout struct Bryan Brattlof
2025-04-24 16:43 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250415151241.3128391-1-d.schultz@phytec.de \
    --to=d.schultz@phytec.de \
    --cc=afd@ti.com \
    --cc=bb@ti.com \
    --cc=n-francis@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=u-kumar1@ti.com \
    --cc=upstream@lists.phytec.de \
    --cc=w.egorov@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox