mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
libfdt: Trivial cleanup for CHECK_HEADER)
Currently the CHECK_HEADER() macro is defined local to fdt_ro.c. However, there are a handful of functions (fdt_move, rw_check_header, fdt_open_into) from other files which could also use it (currently they open-code something more-or-less identical). Therefore, this patch moves CHECK_HEADER() to libfdt_internal.h and uses it in those places. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
a90b5905fe
commit
8a4e75049d
4 changed files with 10 additions and 17 deletions
|
@ -58,6 +58,13 @@
|
|||
#define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
|
||||
#define streq(p, q) (strcmp((p), (q)) == 0)
|
||||
|
||||
#define CHECK_HEADER(fdt) \
|
||||
{ \
|
||||
int err; \
|
||||
if ((err = fdt_check_header(fdt)) != 0) \
|
||||
return err; \
|
||||
}
|
||||
|
||||
uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
|
||||
const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
|
||||
int _fdt_node_end_offset(void *fdt, int nodeoffset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue