From 2f08bfa9526bae4f461e043530cfb903fec0d273 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 20 May 2008 17:19:11 +1000 Subject: libfdt: Several cleanups to parameter checking This patch makes a couple of small cleanups to parameter checking of libfdt functions. - In several functions which take a node offset, we use an idiom involving fdt_next_tag() first to check that we have indeed been given a node offset. This patch adds a helper function _fdt_check_node_offset() to encapsulate this usage of fdt_next_tag(). - In fdt_rw.c in several places we have the expanded version of the RW_CHECK_HEADER() macro for no particular reason. This patch replaces those instances with an invocation of the macro; that's what it's for. - In fdt_sw.c we rename the check_header_sw() function to sw_check_header() to match the analgous function in fdt_rw.c, and we provide an SW_CHECK_HEADER() wrapper macro as RW_CHECK_HEADER() functions in fdt_rw.c Signed-off-by: David Gibson --- libfdt/libfdt_internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libfdt/libfdt_internal.h') diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h index 52e1b8d810..f72e70dbe6 100644 --- a/libfdt/libfdt_internal.h +++ b/libfdt/libfdt_internal.h @@ -66,6 +66,7 @@ } uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset); +int _fdt_check_node_offset(const void *fdt, int offset); const char *_fdt_find_string(const char *strtab, int tabsize, const char *s); int _fdt_node_end_offset(void *fdt, int nodeoffset); -- cgit