Fix compiler warning in fdt_support.c
authorDirk Behme <dirk.behme@googlemail.com>
Sun, 21 Nov 2010 19:19:34 +0000 (20:19 +0100)
committerWolfgang Denk <wd@denx.de>
Sun, 28 Nov 2010 11:41:53 +0000 (12:41 +0100)
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>
common/fdt_support.c

index 5829afd2ad045ee830341a0b2d4f5c2d3bbe370e..6c98e5b07a47269789935160ff8912da21bd034c 100644 (file)
@@ -954,7 +954,7 @@ static void of_bus_default_count_cells(void *blob, int parentoffset,
        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(void *blob, int parentoffset,
        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;
        }