From 49300f2ade6a6ad9b19957b1fce41fccfe1246a3 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 6 Mar 2017 12:04:45 +1100 Subject: dtc: Don't abuse struct fdt_reserve_entry struct fdt_reserve_entry is defined in fdt.h to exactly mirror the in-memory layout of a reserve entry in the flattened tree. Since that is always big-endian, it uses fdt64_t elements, which have sparse annotations marking them as not native endian. However, in dtc, we also use struct fdt_reserve_entry inside struct reserve_info, and use it with native endian values. This will cause sparse errors. This stops this abuse, making struct reserve_info have its own native endian fields for the same information. Signed-off-by: David Gibson --- livetree.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'livetree.c') diff --git a/livetree.c b/livetree.c index 36be9af..3130dd2 100644 --- a/livetree.c +++ b/livetree.c @@ -319,8 +319,8 @@ struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size) memset(new, 0, sizeof(*new)); - new->re.address = address; - new->re.size = size; + new->address = address; + new->size = size; return new; } @@ -599,13 +599,13 @@ static int cmp_reserve_info(const void *ax, const void *bx) a = *((const struct reserve_info * const *)ax); b = *((const struct reserve_info * const *)bx); - if (a->re.address < b->re.address) + if (a->address < b->address) return -1; - else if (a->re.address > b->re.address) + else if (a->address > b->address) return 1; - else if (a->re.size < b->re.size) + else if (a->size < b->size) return -1; - else if (a->re.size > b->re.size) + else if (a->size > b->size) return 1; else return 0; -- cgit v1.1