diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-10-22 16:32:15 +1100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-19 07:01:11 +0200 |
commit | 85d17691faa51925c5bf2316f80612ebb02f7c89 (patch) | |
tree | 750897ee2dab86936c35f228880af183cb98e1a2 /cpukit/dtc/libfdt/libfdt_internal.h | |
parent | Add limited read-only support for older (V2 and V3) device tree to libfdt. (diff) | |
download | rtems-85d17691faa51925c5bf2316f80612ebb02f7c89.tar.bz2 |
libfdt: Clean up header checking functions
Many of the libfdt entry points call some sort of sanity check function
before doing anything else. These need to do slightly different things for
the various classes of functions.
The read-only version is shared with the exported fdt_check_header(), which
limits us a bit in how we can improve it. For that reason split the two
functions apart (though the exported one just calls the ro one for now).
We also rename the functions for more consistency - they're all named
fdt_XX_probe_() where the XX indicates which class of functions they're
for. "probe" is a better "term" than the previous check, since they really
only do minimal validation.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'cpukit/dtc/libfdt/libfdt_internal.h')
-rw-r--r-- | cpukit/dtc/libfdt/libfdt_internal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/dtc/libfdt/libfdt_internal.h b/cpukit/dtc/libfdt/libfdt_internal.h index 7681e19229..4109f890ae 100644 --- a/cpukit/dtc/libfdt/libfdt_internal.h +++ b/cpukit/dtc/libfdt/libfdt_internal.h @@ -55,10 +55,11 @@ #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) -#define FDT_CHECK_HEADER(fdt) \ +int fdt_ro_probe_(const void *fdt); +#define FDT_RO_PROBE(fdt) \ { \ int err_; \ - if ((err_ = fdt_check_header(fdt)) != 0) \ + if ((err_ = fdt_ro_probe_(fdt)) != 0) \ return err_; \ } |