From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: "Pantelis Antoniou"
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
"Simon Glass" <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
"Boris Brezillon"
<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Thomas Petazzoni"
<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"Antoine Ténart"
<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v6 1/4] libfdt: Add new errors for the overlay code
Date: Fri, 30 Sep 2016 11:43:49 +1000 [thread overview]
Message-ID: <20160930014349.GU30519@umbus.fritz.box> (raw)
In-Reply-To: <20160929112908.4468-2-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]
On Thu, Sep 29, 2016 at 01:29:05PM +0200, Maxime Ripard wrote:
> Add a few new error codes to report the failure conditions we might
> encounter in the overlay application code:
> - FDT_ERR_BADFIXUP, when an overlay fixup property is not properly
> formatted.
> - FDT_ERR_BADOVERLAY, when an overlay cannot be parsed, even though its
> structure is correct
So, my thought had been to combine all problems with the overlay for
fixup formatting into a single error code BADOVERLAY.
I'm not opposed to splitting that up more, but there should be a
coherent guideline about what's BADFIXUP and what's BADOVERLAY.
> - FDT_ERR_NOPHANDLES, when we ran out of available phandles and we
> cannot use a new phandle without either using an invalid one (-1 or
> 0), or one already used.
>
> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> libfdt/fdt_strerror.c | 3 +++
> libfdt/libfdt.h | 15 ++++++++++++++-
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c
> index e6c3ceee8c58..70a36291466f 100644
> --- a/libfdt/fdt_strerror.c
> +++ b/libfdt/fdt_strerror.c
> @@ -76,6 +76,9 @@ static struct fdt_errtabent fdt_errtable[] = {
> FDT_ERRTABENT(FDT_ERR_BADVERSION),
> FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE),
> FDT_ERRTABENT(FDT_ERR_BADLAYOUT),
> + FDT_ERRTABENT(FDT_ERR_BADFIXUP),
> + FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
> + FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
> };
> #define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
>
> diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
> index ecb11fc9e985..81907815fda1 100644
> --- a/libfdt/libfdt.h
> +++ b/libfdt/libfdt.h
> @@ -126,7 +126,20 @@
> * value. For example: a property expected to contain a string list
> * is not NUL-terminated within the length of its value. */
>
> -#define FDT_ERR_MAX 15
> +#define FDT_ERR_BADFIXUP 16
> + /* FDT_ERR_BADFIXUP: One of the device tree overlay fixup is
> + * not formatted properly. */
> +
> +#define FDT_ERR_BADOVERLAY 17
> + /* FDT_ERR_BADOVERLAY: The device tree overlay, while
> + * correctly structured, cannot be applied due to some
> + * unexpected or missing value, property or node. */
> +
> +#define FDT_ERR_NOPHANDLES 18
> + /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
> + * phandle available anymore without causing an overflow */
> +
> +#define FDT_ERR_MAX 18
>
> /**********************************************************************/
> /* Low-level functions (you probably don't need these) */
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-30 1:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 11:29 [PATCH v6 0/4] libfdt: Add support for device tree overlays Maxime Ripard
[not found] ` <20160929112908.4468-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-29 11:29 ` [PATCH v6 1/4] libfdt: Add new errors for the overlay code Maxime Ripard
[not found] ` <20160929112908.4468-2-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-30 1:43 ` David Gibson [this message]
[not found] ` <20160930014349.GU30519-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-09-30 12:24 ` Maxime Ripard
2016-09-29 11:29 ` [PATCH v6 2/4] libfdt: Extend the reach of FDT_ERR_BADPHANDLE Maxime Ripard
2016-09-29 11:29 ` [PATCH v6 3/4] libfdt: Add overlay application function Maxime Ripard
[not found] ` <20160929112908.4468-4-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-30 1:42 ` David Gibson
2016-09-29 11:29 ` [PATCH v6 4/4] tests: Add tests cases for the overlay code Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160930014349.GU30519@umbus.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).