U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mach-k3: common_fdt: Fix Label Issue
@ 2025-04-07  6:07 Daniel Schultz
  2025-04-07  8:21 ` Kumar, Udit
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daniel Schultz @ 2025-04-07  6:07 UTC (permalink / raw)
  To: trini, n-francis, u-kumar1, bb, afd, u-boot
  Cc: upstream, w.egorov, Daniel Schultz

Labels are not allowed before declarations. Add a semicolon after the
label to introduce an empty statement. 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>
---

I'm open to other suggestions! This is just the easiest way to fix this
compile error. BTW, master is fine since 096aa229a9e is only on next.

 arch/arm/mach-k3/common_fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
index 361b0c0b31b..7178918a12c 100644
--- a/arch/arm/mach-k3/common_fdt.c
+++ b/arch/arm/mach-k3/common_fdt.c
@@ -152,7 +152,7 @@ int fdt_fixup_reserved(void *blob, const char *name,
 		}
 	}
 
-add_carveout:
+add_carveout: ;
 	struct fdt_memory carveout = {
 		.start = new_address,
 		.end = new_address + new_size - 1,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-07  6:07 [PATCH] mach-k3: common_fdt: Fix Label Issue Daniel Schultz
@ 2025-04-07  8:21 ` Kumar, Udit
  2025-04-07  8:26   ` Neha Malcom Francis
  2025-04-07 20:15 ` Bryan Brattlof
  2025-04-14 22:59 ` Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Kumar, Udit @ 2025-04-07  8:21 UTC (permalink / raw)
  To: Daniel Schultz, trini, n-francis, bb, afd, u-boot; +Cc: upstream, w.egorov

Hi Daniel.

Thanks for patch

On 4/7/2025 11:37 AM, Daniel Schultz wrote:
> Labels are not allowed before declarations. Add a semicolon after the
> label to introduce an empty statement. 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

Is there some specific compiler option you are using, Sorry but I don't 
see this error .

i just build sha id e458e103d4f5fb7aaf13e744c65916ab3ba4a18d of next


>
> Fixes: 096aa229a9e ("mach-k3: common_fdt: create a reserved memory node")
>
> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
>
> I'm open to other suggestions! This is just the easiest way to fix this
> compile error. BTW, master is fine since 096aa229a9e is only on next.
>
>   arch/arm/mach-k3/common_fdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
> index 361b0c0b31b..7178918a12c 100644
> --- a/arch/arm/mach-k3/common_fdt.c
> +++ b/arch/arm/mach-k3/common_fdt.c
> @@ -152,7 +152,7 @@ int fdt_fixup_reserved(void *blob, const char *name,
>   		}
>   	}
>   
> -add_carveout:
> +add_carveout: ;
>   	struct fdt_memory carveout = {
>   		.start = new_address,
>   		.end = new_address + new_size - 1,

My suggestion will be to move this struct at start of function.

and change only size here

carveout.end = new_address + new_size - 1;



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-07  8:21 ` Kumar, Udit
@ 2025-04-07  8:26   ` Neha Malcom Francis
  2025-04-09  7:14     ` Daniel Schultz
  0 siblings, 1 reply; 7+ messages in thread
From: Neha Malcom Francis @ 2025-04-07  8:26 UTC (permalink / raw)
  To: Kumar, Udit, Daniel Schultz, trini, bb, afd, u-boot; +Cc: upstream, w.egorov

Hi Udit

On 07/04/25 13:51, Kumar, Udit wrote:
> Hi Daniel.
> 
> Thanks for patch
> 
> On 4/7/2025 11:37 AM, Daniel Schultz wrote:
>> Labels are not allowed before declarations. Add a semicolon after the
>> label to introduce an empty statement. 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
> 
> Is there some specific compiler option you are using, Sorry but I don't
> see this error .
> 
> i just build sha id e458e103d4f5fb7aaf13e744c65916ab3ba4a18d of next
> 

I had run into the same issue when I was using v10.1 of the Arm GNU
toolchain, moving to v14.2, I no longer see it.

> 
>>
>> Fixes: 096aa229a9e ("mach-k3: common_fdt: create a reserved memory node")
>>
>> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
>> ---
>>
>> I'm open to other suggestions! This is just the easiest way to fix this
>> compile error. BTW, master is fine since 096aa229a9e is only on next.
>>
>>   arch/arm/mach-k3/common_fdt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-k3/common_fdt.c
>> b/arch/arm/mach-k3/common_fdt.c
>> index 361b0c0b31b..7178918a12c 100644
>> --- a/arch/arm/mach-k3/common_fdt.c
>> +++ b/arch/arm/mach-k3/common_fdt.c
>> @@ -152,7 +152,7 @@ int fdt_fixup_reserved(void *blob, const char *name,
>>           }
>>       }
>>   -add_carveout:
>> +add_carveout: ;
>>       struct fdt_memory carveout = {
>>           .start = new_address,
>>           .end = new_address + new_size - 1,
> 
> My suggestion will be to move this struct at start of function.
> 
> and change only size here
> 
> carveout.end = new_address + new_size - 1;
> 
> 

-- 
Thanking You
Neha Malcom Francis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-07  6:07 [PATCH] mach-k3: common_fdt: Fix Label Issue Daniel Schultz
  2025-04-07  8:21 ` Kumar, Udit
@ 2025-04-07 20:15 ` Bryan Brattlof
  2025-04-14 22:59 ` Tom Rini
  2 siblings, 0 replies; 7+ messages in thread
From: Bryan Brattlof @ 2025-04-07 20:15 UTC (permalink / raw)
  To: Daniel Schultz
  Cc: trini, n-francis, u-kumar1, afd, u-boot, upstream, w.egorov

On April  6, 2025 thus sayeth Daniel Schultz:
> Labels are not allowed before declarations. Add a semicolon after the
> label to introduce an empty statement. 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>
> ---
> 
> I'm open to other suggestions! This is just the easiest way to fix this
> compile error. BTW, master is fine since 096aa229a9e is only on next.
> 

Ha I learn something new every day. It makes sense as we can't declare
variables inside switch statements so the same rules should apply when 
adding jump labels at the function scope.

I was never really in love with the layout of this function, my thought
was to move that carveout structure to the top with all the other 
declarations but I'm not apposed to the null statement here either.

Thanks for fixing this
~Bryan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-07  8:26   ` Neha Malcom Francis
@ 2025-04-09  7:14     ` Daniel Schultz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Schultz @ 2025-04-09  7:14 UTC (permalink / raw)
  To: Neha Malcom Francis, Kumar, Udit, trini, bb, afd, u-boot
  Cc: upstream, w.egorov


On 4/7/25 10:26, Neha Malcom Francis wrote:
> Hi Udit
>
> On 07/04/25 13:51, Kumar, Udit wrote:
>> Hi Daniel.
>>
>> Thanks for patch
>>
>> On 4/7/2025 11:37 AM, Daniel Schultz wrote:
>>> Labels are not allowed before declarations. Add a semicolon after the
>>> label to introduce an empty statement. 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
>> Is there some specific compiler option you are using, Sorry but I don't
>> see this error .
>>
>> i just build sha id e458e103d4f5fb7aaf13e744c65916ab3ba4a18d of next
>>
> I had run into the same issue when I was using v10.1 of the Arm GNU
> toolchain, moving to v14.2, I no longer see it.

I'm currently using "aarch64-linux-gnu-gcc (Ubuntu 
9.4.0-1ubuntu1~20.04.2) 9.4.0" with just make.

>
>>> Fixes: 096aa229a9e ("mach-k3: common_fdt: create a reserved memory node")
>>>
>>> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
>>> ---
>>>
>>> I'm open to other suggestions! This is just the easiest way to fix this
>>> compile error. BTW, master is fine since 096aa229a9e is only on next.
>>>
>>>    arch/arm/mach-k3/common_fdt.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-k3/common_fdt.c
>>> b/arch/arm/mach-k3/common_fdt.c
>>> index 361b0c0b31b..7178918a12c 100644
>>> --- a/arch/arm/mach-k3/common_fdt.c
>>> +++ b/arch/arm/mach-k3/common_fdt.c
>>> @@ -152,7 +152,7 @@ int fdt_fixup_reserved(void *blob, const char *name,
>>>            }
>>>        }
>>>    -add_carveout:
>>> +add_carveout: ;
>>>        struct fdt_memory carveout = {
>>>            .start = new_address,
>>>            .end = new_address + new_size - 1,
>> My suggestion will be to move this struct at start of function.
>>
>> and change only size here
>>
>> carveout.end = new_address + new_size - 1;

sounds good.

- Daniel

>>
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-07  6:07 [PATCH] mach-k3: common_fdt: Fix Label Issue Daniel Schultz
  2025-04-07  8:21 ` Kumar, Udit
  2025-04-07 20:15 ` Bryan Brattlof
@ 2025-04-14 22:59 ` Tom Rini
  2025-04-16  5:18   ` Daniel Schultz
  2 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2025-04-14 22:59 UTC (permalink / raw)
  To: Daniel Schultz; +Cc: n-francis, u-kumar1, bb, afd, u-boot, upstream, w.egorov

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

On Sun, Apr 06, 2025 at 11:07:11PM -0700, Daniel Schultz wrote:
> Labels are not allowed before declarations. Add a semicolon after the
> label to introduce an empty statement. 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>
> ---
> 
> I'm open to other suggestions! This is just the easiest way to fix this
> compile error. BTW, master is fine since 096aa229a9e is only on next.

Is this the only warning you get with Ubuntu 20.04's gcc? But I would
also rather see Udit's suggestion on how to fix it rather than adding a
';' here as that looks like a stray character rather than an intentional
but not always obvious fix. Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mach-k3: common_fdt: Fix Label Issue
  2025-04-14 22:59 ` Tom Rini
@ 2025-04-16  5:18   ` Daniel Schultz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Schultz @ 2025-04-16  5:18 UTC (permalink / raw)
  To: Tom Rini; +Cc: n-francis, u-kumar1, bb, afd, u-boot, upstream, w.egorov


On 4/15/25 00:59, Tom Rini wrote:
> On Sun, Apr 06, 2025 at 11:07:11PM -0700, Daniel Schultz wrote:
>> Labels are not allowed before declarations. Add a semicolon after the
>> label to introduce an empty statement. 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>
>> ---
>>
>> I'm open to other suggestions! This is just the easiest way to fix this
>> compile error. BTW, master is fine since 096aa229a9e is only on next.
> Is this the only warning you get with Ubuntu 20.04's gcc? But I would
> also rather see Udit's suggestion on how to fix it rather than adding a
> ';' here as that looks like a stray character rather than an intentional
> but not always obvious fix. Thanks.

I agree. See patch [1] from yesterday which should be good to go.

- Daniel

1: https://lists.denx.de/pipermail/u-boot/2025-April/586915.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-16  5:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07  6:07 [PATCH] mach-k3: common_fdt: Fix Label Issue Daniel Schultz
2025-04-07  8:21 ` Kumar, Udit
2025-04-07  8:26   ` Neha Malcom Francis
2025-04-09  7:14     ` Daniel Schultz
2025-04-07 20:15 ` Bryan Brattlof
2025-04-14 22:59 ` Tom Rini
2025-04-16  5:18   ` Daniel Schultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox