Skip to contentSkip to conversation

Fix compiler warning in fdt_support.c

PATCH New dirk.behme at googlemail.com 4 participants 4 messages Nov 21, 2010 – Nov 28, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compiler warning in fdt_support.c

From: Dirk Behme <[email protected]>

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 *'.

---

Found while building 'omap3_beagle'.

 common/fdt_support.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/fdt_support.c +2 -2
Index: 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;
 	}
#1 lore raw

PATCH 1/1 Fix compiler warning in fdt_support.c

Le 21/11/2010 20:19, dirk.behme at googlemail.com a ?crit :

Quoted 33 lines

From: Dirk Behme<[email protected]>

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 *'.

---

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
===================================================================

common/fdt_support.c +1 -1
@@ -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;
  	}

common/fdt_support.c static void of_bus_default_count_cells(v · line 968

Quoted 8 lines
common/fdt_support.c +1 -1
@@ -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,

Signature · 1 line
Albert.
#2 lore raw

PATCH 1/1 Fix compiler warning in fdt_support.c

In reply to dirk.behme at googlemail.com

Dear dirk.behme at googlemail.com,

Quoted 8 lines · In message <[email protected]> you wrote:

From: Dirk Behme <[email protected]>

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

Quoted 7 lines

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

---

Found while building 'omap3_beagle'.

Applied, thank.

Gerry, hope this is OK with you.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I object to intellect without discipline;  I object to power without
constructive purpose.
	-- Spock, "The Squire of Gothos", stardate 2124.5
#3 lore raw

PATCH 1/1 Fix compiler warning in fdt_support.c

Quoted 15 lines · Wolfgang Denk

Dear dirk.behme at googlemail.com,

Quoted 12 lines · In message<[email protected]> you wrote:

From: Dirk Behme<[email protected]>

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 *'.

Quoted 7 lines
Quoted 3 lines

---

Found while building 'omap3_beagle'.

Applied, thank.

Gerry, hope this is OK with you.

Yes, thanks.

Quoted 2 lines

Best regards,
Wolfgang Denk

Best regards,
gvb