]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
libfdt: update from upstream dtc commit 142419e
authorKim Phillips <kim.phillips@freescale.com>
Wed, 16 Jan 2013 13:59:50 +0000 (13:59 +0000)
committerGerald Van Baren <gvb@unssw.com>
Fri, 8 Feb 2013 01:38:55 +0000 (20:38 -0500)
commit 142419e "dtc/libfdt: sparse fixes", for u-boot's libfdt copy.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Jerry Van Baren <gvb.uboot@gmail.com>
include/libfdt.h
lib/libfdt/fdt.c
lib/libfdt/fdt_ro.c
lib/libfdt/fdt_rw.c
lib/libfdt/fdt_sw.c
lib/libfdt/fdt_wip.c

index c93ae28833e172c3bca7ee188da1c200f3eb27c5..fc7f75b9ffa60b6bc23f44d39b59c4d0f4b7be3b 100644 (file)
@@ -882,8 +882,8 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
                                          const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -917,8 +917,8 @@ static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
                                          const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -993,13 +993,13 @@ int fdt_begin_node(void *fdt, const char *name);
 int fdt_property(void *fdt, const char *name, const void *val, int len);
 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_property(fdt, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
 }
 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_property(fdt, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
 }
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
 {
@@ -1154,8 +1154,8 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
                                  uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1189,8 +1189,8 @@ static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
                                  uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1296,8 +1296,8 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
                                     const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1331,8 +1331,8 @@ static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
                                     const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
index 4157b21efda2eb11585a0e1bf08d94cd8e754a24..387e3544b7e578832eb4f27b443547b92d7e966a 100644 (file)
@@ -96,7 +96,7 @@ const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
 
 uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
 {
-       const uint32_t *tagp, *lenp;
+       const fdt32_t *tagp, *lenp;
        uint32_t tag;
        int offset = startoffset;
        const char *p;
index 1933010fd8f170a020ee1ab7cffd282ce2ff00d2..1a461c3e9795150ffe154568e68dc81b70afd77b 100644 (file)
@@ -326,7 +326,7 @@ const void *fdt_getprop(const void *fdt, int nodeoffset,
 
 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
 {
-       const uint32_t *php;
+       const fdt32_t *php;
        int len;
 
        /* FIXME: This is a bit sub-optimal, since we potentially scan
index 5ed23d6f1934699540b60cb437f0c740dc43956c..aba60948416e1cd7a802770f94627089d685446e 100644 (file)
@@ -343,7 +343,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
        int nodelen;
        int err;
        uint32_t tag;
-       uint32_t *endtag;
+       fdt32_t *endtag;
 
        FDT_RW_CHECK_HEADER(fdt);
 
@@ -370,7 +370,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
        nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
        memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
        memcpy(nh->name, name, namelen);
-       endtag = (uint32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
+       endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
        *endtag = cpu_to_fdt32(FDT_END_NODE);
 
        return offset;
index 55ebebf1eb20e8c7f9200881f99ecf03632db9a3..f422754de9d28df97b99db3506e6b2135dfb4921 100644 (file)
@@ -153,7 +153,7 @@ int fdt_begin_node(void *fdt, const char *name)
 
 int fdt_end_node(void *fdt)
 {
-       uint32_t *en;
+       fdt32_t *en;
 
        FDT_SW_CHECK_HEADER(fdt);
 
@@ -213,7 +213,7 @@ int fdt_property(void *fdt, const char *name, const void *val, int len)
 int fdt_finish(void *fdt)
 {
        char *p = (char *)fdt;
-       uint32_t *end;
+       fdt32_t *end;
        int oldstroffset, newstroffset;
        uint32_t tag;
        int offset, nextoffset;
index e373677c504d1d854af0151f535ce508b1eeddfc..63e67b78c882b5621d30c6a2214034ba7c40356a 100644 (file)
@@ -78,7 +78,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
 
 static void _fdt_nop_region(void *start, int len)
 {
-       uint32_t *p;
+       fdt32_t *p;
 
        for (p = start; (char *)p < ((char *)start + len); p++)
                *p = cpu_to_fdt32(FDT_NOP);