From d0ccb9b140b472039732de102fc14597eedb14df Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 18 Feb 2008 18:06:31 +1100 Subject: 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 --- libfdt/fdt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libfdt/fdt.c') diff --git a/libfdt/fdt.c b/libfdt/fdt.c index c61fb531b..bd9171237 100644 --- a/libfdt/fdt.c +++ b/libfdt/fdt.c @@ -184,10 +184,7 @@ const char *_fdt_find_string(const char *strtab, int tabsize, const char *s) int fdt_move(const void *fdt, void *buf, int bufsize) { - int err = fdt_check_header(fdt); - - if (err) - return err; + CHECK_HEADER(fdt); if (fdt_totalsize(fdt) > bufsize) return -FDT_ERR_NOSPACE; -- cgit v1.2.3