RE: [RFC PATCH] dtc: Add support for named constants

Started by Paul Walmsley on Aug 30, 2011

open the first message on its own page

Message details and related content
Hi,

On Tue, 30 Aug 2011, Stephen Warren wrote:
David Gibson wrote at Monday, August 29, 2011 10:23 PM:
quoted
On Tue, Aug 23, 2011 at 04:43:20PM -0600, Stephen Warren wrote:
quoted
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>;
...
quoted
quoted
Note 2: I'd prefer the syntax of /define/ to be:

/define/ TWO 2;
Some preprocessing support would be very useful for us on OMAP, where we 
have some register bitfields that we'd like to use symbolic names for.

One question, though.  Documentation/devicetree/booting-without-of.txt[1] 
says:

   It is also suggested that you pipe your source file through cpp (gcc
   preprocessor) so you can use #include's, #define for constants, 
   etc...

Is it no longer recommended to use cpp for this purpose?


- Paul

1. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/devicetree/booting-without-of.txt;h=7c1329de0596a34ce81d60f214d46a43933f05c0;hb=HEAD#l1119
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help