Patchwork [U-Boot] Fix compiler warning in fdt_support.c

login
register
mail settings
Submitter Dirk Behme
Date Nov. 21, 2010, 7:19 p.m.
Message ID <1290367174-380-1-git-send-email-dirk.behme@gmail.com>
Download mbox | patch
Permalink /patch/72453/
State Accepted
Commit 71ae5f7a3fde5958c116dc75097ca77faa947ac4
Headers show

Comments

Dirk Behme - Nov. 21, 2010, 7:19 p.m.
From: Dirk Behme <dirk.behme@googlemail.com>

Fix compiler warning

fdt_support.c: In function 'of_bus_default_count_cells':
fdt_support.c:957: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
fdt_support.c:965: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type

be32_to_cpup() expects an 'u32 *' while prop is 'const u32 *'.

Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>

---

Found while building 'omap3_beagle'.

 common/fdt_support.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Albert ARIBAUD - Nov. 28, 2010, 9:10 a.m.
Le 21/11/2010 20:19, dirk.behme@googlemail.com a écrit :
> From: Dirk Behme<dirk.behme@googlemail.com>
>
> Fix compiler warning
>
> fdt_support.c: In function 'of_bus_default_count_cells':
> fdt_support.c:957: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
> fdt_support.c:965: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
>
> be32_to_cpup() expects an 'u32 *' while prop is 'const u32 *'.
>
> Signed-off-by: Dirk Behme<dirk.behme@googlemail.com>
>
> ---
>
> Found while building 'omap3_beagle'.
>
>   common/fdt_support.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: u-boot.git/common/fdt_support.c
> ===================================================================
> --- u-boot.git.orig/common/fdt_support.c
> +++ u-boot.git/common/fdt_support.c
> @@ -954,7 +954,7 @@ static void of_bus_default_count_cells(v
>   	if (addrc) {
>   		prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL);
>   		if (prop)
> -			*addrc = be32_to_cpup(prop);
> +			*addrc = be32_to_cpup((u32 *)prop);
>   		else
>   			*addrc = 2;
>   	}
> @@ -962,7 +962,7 @@ static void of_bus_default_count_cells(v
>   	if (sizec) {
>   		prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL);
>   		if (prop)
> -			*sizec = be32_to_cpup(prop);
> +			*sizec = be32_to_cpup((u32 *)prop);
>   		else
>   			*sizec = 1;
>   	}

Maybe we could pull this patch in? That will raise the count of ARM 
boards building clean.

Amicalement,
Wolfgang Denk - Nov. 28, 2010, 11:42 a.m.
Dear dirk.behme@googlemail.com,

In message <1290367174-380-1-git-send-email-dirk.behme@gmail.com> you wrote:
> From: Dirk Behme <dirk.behme@googlemail.com>
> 
> Fix compiler warning
> 
> fdt_support.c: In function 'of_bus_default_count_cells':
> fdt_support.c:957: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
> fdt_support.c:965: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
> 
> be32_to_cpup() expects an 'u32 *' while prop is 'const u32 *'.
> 
> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
> 
> ---
> 
> Found while building 'omap3_beagle'.

Applied, thank.

Gerry, hope this is OK with you.

Best regards,

Wolfgang Denk
Jerry Van Baren - Nov. 28, 2010, 5:30 p.m.
On 11/28/2010 06:42 AM, Wolfgang Denk wrote:
> Dear dirk.behme@googlemail.com,
>
> In message<1290367174-380-1-git-send-email-dirk.behme@gmail.com>  you wrote:
>> From: Dirk Behme<dirk.behme@googlemail.com>
>>
>> Fix compiler warning
>>
>> fdt_support.c: In function 'of_bus_default_count_cells':
>> fdt_support.c:957: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
>> fdt_support.c:965: warning: passing argument 1 of '__swab32p' discards qualifiers from pointer target type
>>
>> be32_to_cpup() expects an 'u32 *' while prop is 'const u32 *'.
>>
>> Signed-off-by: Dirk Behme<dirk.behme@googlemail.com>
>>
>> ---
>>
>> Found while building 'omap3_beagle'.
>
> Applied, thank.
>
> Gerry, hope this is OK with you.

Yes, thanks.

> Best regards,
> Wolfgang Denk

Best regards,
gvb

Patch

Index: u-boot.git/common/fdt_support.c
===================================================================
--- u-boot.git.orig/common/fdt_support.c
+++ u-boot.git/common/fdt_support.c
@@ -954,7 +954,7 @@  static void of_bus_default_count_cells(v
 	if (addrc) {
 		prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL);
 		if (prop)
-			*addrc = be32_to_cpup(prop);
+			*addrc = be32_to_cpup((u32 *)prop);
 		else
 			*addrc = 2;
 	}
@@ -962,7 +962,7 @@  static void of_bus_default_count_cells(v
 	if (sizec) {
 		prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL);
 		if (prop)
-			*sizec = be32_to_cpup(prop);
+			*sizec = be32_to_cpup((u32 *)prop);
 		else
 			*sizec = 1;
 	}