mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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 <david@gibson.dropbear.id.au>
This commit is contained in:
parent
fa8bc7f928
commit
49300f2ade
5 changed files with 21 additions and 22 deletions
10
data.c
10
data.c
|
@ -197,14 +197,14 @@ struct data data_append_integer(struct data d, uint64_t value, int bits)
|
|||
}
|
||||
}
|
||||
|
||||
struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
|
||||
struct data data_append_re(struct data d, uint64_t address, uint64_t size)
|
||||
{
|
||||
struct fdt_reserve_entry bere;
|
||||
struct fdt_reserve_entry re;
|
||||
|
||||
bere.address = cpu_to_fdt64(re->address);
|
||||
bere.size = cpu_to_fdt64(re->size);
|
||||
re.address = cpu_to_fdt64(address);
|
||||
re.size = cpu_to_fdt64(size);
|
||||
|
||||
return data_append_data(d, &bere, sizeof(bere));
|
||||
return data_append_data(d, &re, sizeof(re));
|
||||
}
|
||||
|
||||
struct data data_append_cell(struct data d, cell_t word)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue