[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC for-4.8 v2 4/7] xen/device-tree: Make dt_match_node match props



Hi Edgar,

On 09/06/16 17:04, Edgar E. Iglesias wrote:
On Wed, Jun 08, 2016 at 09:44:51AM +0100, Julien Grall wrote:

On 07/06/2016 21:43, Edgar E. Iglesias wrote:
On Mon, Jun 06, 2016 at 06:39:39PM +0100, Julien Grall wrote:
On 03/06/16 14:29, Edgar E. Iglesias wrote:

[...]

AFAIK, it's needed to instantiate the dynamically sized array of pointers.
Another option is to make __DT_MATCH_PROPS take the char ** pointer.
The descriptor declaration would instead of looking like this:
    {
        __DT_MATCH_COMPATIBLE("mmio-sram"),
        __DT_MATCH_PROPS("no-memory-wc"),
        .data = &mattr_device_rw,
    },

Look something like this:

const char *props_no_mem_wc[] = { "no-memory-wc", NULL };

....

    {
        __DT_MATCH_COMPATIBLE("mmio-sram"),
        __DT_MATCH_PROPS(props_no_mem_wc),
        .data = &mattr_device_rw,
    },


Or do you have better suggestions?

How about defining props with the type "const char *props[]"?


That doesn't work for arrays of match descriptors (i.e you can't have arrays of 
variable sized objects)...

Hmmmm... I would rather try to avoid the cast, but the other solution you suggested does not look appealing (i.e declare separately the properties).

However do you have a use case where checking multiple properties would be useful? If not, I would just handle one property for now.

Regards,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.