Go to file
David Gibson 9a9fdf5991 libfdt: More consistent handling of returned error codes.
At present, libfdt functions returning a structure offset return a
zero-or-positive offset on success, and return a negative error code
on failure.  Functions which only return an error code return a
positive version of the error code, or 0 on success.

This patch improves consistency by always returning negative error
codes on failure, for both types of function.  With this change, we do
away with the special fdt_offset_error() macro for checking whether a
returned offset value is an error and extracting the encoded error
value within.  Instead an explicit (ret_value < 0) is now the
preferred way of checking return values for both offset-returning and
error-code-returning functions.

The fdt_strerror() function in the test code is updated
correspondingly to make more sense with the new conventions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2006-12-15 15:12:51 +11:00
tests libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
.gitignore libfdt - library for manipulating device trees in flattened format 2006-11-27 16:21:28 +11:00
GPL Add a copy of the GPL 2006-11-29 16:49:27 +11:00
Makefile libfdt: Read-write support 2006-12-01 16:59:43 +11:00
fdt.c libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
fdt.h libfdt: Introduce flat tree format v17 2006-12-01 16:25:39 +11:00
fdt_ro.c libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
fdt_rw.c libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
fdt_sw.c libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
fdt_wip.c libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
libfdt.h libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00
libfdt_env.h libfdt: Export accessors for header fields 2006-12-01 15:02:10 +11:00
libfdt_internal.h libfdt: More consistent handling of returned error codes. 2006-12-15 15:12:51 +11:00