libfdt: Clean up error codes

First, this patch removes several underused error codes:
FDT_ERR_BADPOINTER and FDT_ERR_BADHEADER were not used at all and are
simply removed.  FDT_ERR_SIZE_MISMATCH was very similar in spirit to
FDT_ERR_NOSPACE, and used only in circumstances where there can be no
confusion between the two, so is removed and folded into
FDT_ERR_NOSPACE.  FDT_ERR_INTERAL was used on only one place, on a
"can't happen" check.  It seems of little value so the check and error
code are removed also.

Second, the error codes have been re-numbered and grouped roughly by
severity.  That is codes which can reasonably occur in normal
operation separated from those which indicate bad parameters (and
therefore a bug in the caller) or a bad or corrupted device tree blob.

Third the test function fdt_strerror() is cleaned up a little based on
these changes.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2006-12-15 15:12:52 +11:00
parent 9a9fdf5991
commit 3aea828501
4 changed files with 37 additions and 37 deletions

View file

@ -161,9 +161,6 @@ struct fdt_property *fdt_get_property(const void *fdt,
do {
offset = nextoffset;
err = -FDT_ERR_INTERNAL;
if (offset % FDT_TAGSIZE)
goto fail;
tag = _fdt_next_tag(fdt, offset, &nextoffset);
switch (tag) {