[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v01 1/3] xen:dt: add match for non-available nodes
On Thu, 2014-06-26 at 14:15 +0300, Andrii Tseglytskyi wrote: > From: Andrii Anisov <andrii.anisov@xxxxxxxxxxxxxxx> > > Signed-off-by: Andrii Anisov <andrii.anisov@xxxxxxxxxxxxxxx> > --- > xen/common/device_tree.c | 6 +++++- > xen/include/xen/device_tree.h | 2 ++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c > index 55716a8..f0bd7b9 100644 > --- a/xen/common/device_tree.c > +++ b/xen/common/device_tree.c > @@ -692,7 +692,8 @@ bool_t dt_match_node(const struct dt_device_match > *matches, > if ( !matches ) > return 0; > > - while ( matches->path || matches->type || matches->compatible ) > + while ( matches->path || matches->type || > + matches->compatible || matches->nav) > { > bool_t match = 1; > > [...] > diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h > index 9a8c3de..99de53f 100644 > --- a/xen/include/xen/device_tree.h > +++ b/xen/include/xen/device_tree.h > @@ -62,11 +62,13 @@ struct dt_device_match { > const char *path; > const char *type; > const char *compatible; > + int nav; Can you make this "bool_t not_available" please. > }; > > #define DT_MATCH_PATH(p) { .path = p } > #define DT_MATCH_TYPE(typ) { .type = typ } > #define DT_MATCH_COMPATIBLE(compat) { .compatible = compat } > +#define DT_MATCH_NOT_AVAILABLE() { .nav = 1 } I'd actually prefer DT_MATCH_AVAILABLE(true) / BT_MATCH_AVAILABLE(false) but I see that would interact in complicated ways with the while loop up above (requiring you to or-in a present flag or something gross). Since the not available case is most likely to be the useful one I think we can live with what you have. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |