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

Stephen Warren swarren at nvidia.com
Wed Sep 21 03:02:18 EST 2011


Jon Loeliger wrote at Tuesday, September 20, 2011 7:48 AM:
> David Gibson wrote:
> > Things get trickier when we want to extend this to macros or
> > functions.  The only problem I have with your patch at present is that
> > I'd prefer not to implement a constant defining syntax, only to have
> > it obsoleted by whatever we do for macros or functions.
> 
> Exactly.
> 
> > So, there are basically two approaches to macro or function support.
> >
> > A) Functions
> > B) Macros
> >   B1) Use cpp itself
> >   B2) Make our own preprocessor, isomorphic to cpp
> 
> To be thorough, there has been one other macro proposal: Use m4.
> Suggesting that, however, has had the entertaining side effect
> of causing internet-wide vomiting.
> 
> > Our current impasse is roughly that Jon prefers approach (A), whereas
> > I prefer (B1) on balance.  (B1) would obsolete your suggested define
> > syntax.  (A) and (B2) could both potentially subsume it, instead.
> 
> Right.

OK, that all makes sense.

However, it leaves me wondering what the next steps are; I was hoping to
get a quick and simple constant syntax into dtc that I could use for the
pinmux initialization patches I was working on, so the data tables there
would be integer-based for efficiency, yet named using constant names
instead of seemingly random numbers. It sounds like the dtc issue isn't
going to be resolved particularly quickly; should I just go back to using
strings in my pinmux patches? But that'd tie us to using strings forever
in order for the bindings to remain compatible...

-- 
nvpublic



More information about the devicetree-discuss mailing list