[PATCH v2] dtc: Add support for named integer constants

Stephen Warren swarren at nvidia.com
Sat Sep 3 04:34:25 EST 2011


Stephen Warren wrote at Tuesday, August 30, 2011 3:30 PM:
> You may define constants as follows:
> 
> /define/ TWO 2;
> /define/ FOUR 4;
> /define/ OTHER FOUR;
> 
> And properties may use these values as follows:
> 
> foo = <1 TWO 3 FOUR 5>;
> 
> Signed-off-by: Stephen Warren <swarren at nvidia.com>

David, Jon,

Does this seem reasonable?

I think the syntax is simple enough it wouldn't interfere with any more
advanced expression/function/... support in the future, and it could be
easily extended to allow e.g.:

/define/ FOO "BAR";
/define/ BAX [0af8dacb0];
...

And even arbitrary expressions on the RHS as/when/if support is added
for those more generally:

/define/ A (B | (C << 2));

-- 
nvpublic



More information about the devicetree-discuss mailing list