From: Mitch Bradley <wmb@firmworks.com> To: Stephen Warren <swarren@wwwdotorg.org> Cc: Rob Herring <robherring2@gmail.com>, Michal Marek <mmarek@suse.cz>, Stephen Warren <swarren@nvidia.com>, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: dtc: import latest upstream dtc Date: Wed, 10 Oct 2012 08:56:11 -1000 [thread overview] Message-ID: <5075C4CB.8020409@firmworks.com> (raw) In-Reply-To: <5075C254.4040304@wwwdotorg.org> On 10/10/2012 8:45 AM, Stephen Warren wrote: > On 10/10/2012 12:23 PM, Mitch Bradley wrote: >> On 10/10/2012 7:09 AM, Rob Herring wrote: >>> On 10/09/2012 04:16 PM, Stephen Warren wrote: >>>> On 10/01/2012 12:39 PM, Jon Loeliger wrote: >>>>>> >>>>>> What more do you think needs discussion re: dtc+cpp? >>>>> >>>>> How not to abuse the ever-loving shit out of it? :-) >>>> >>>> Perhaps we can just handle this through the regular patch review >>>> process; I think it may be difficult to define and agree upon exactly >>>> what "abuse" means ahead of time, but it's probably going to be easy >>>> enough to recognize it when one sees it? >>> >>> Rather than repeating things over and over in reviews, we should >>> document at least rules we can easily agree on and then add to it when >>> people get "creative." Also, I can't keep up with every single binding >>> review as is, and this could just add another level of complexity to the >>> review. A few off the top of my head and from the thread discussion: >>> >>> - Headers must be self contained with no outside (i.e. libc, kernel, >>> etc.) header dependencies. >>> - No kernel kconfig option usage >>> - No gcc built-in define usage >>> - No unused items (i.e. externs, structs, etc.) >>> - No macro concatenation >>> - No macros for strings or property names >> >> Instead of making a bunch of rules about how you can only use a small >> subset of cpp, why not just add a "define name value" command to DTC? > > I implemented a patch to do exactly that, and it was rejected because it > only solved part of the problem (named constants) and not the reset (a > completely generic macro language/... within dtc). The argument was that > defining just the named constant syntax on its own without knowing what > the unspecified future macro language will look like might result in the > named constant syntax not fitting into it. > > That all said, I now think that using cpp is actually a much better > solution that adding yet more dtc-specific syntax. The *huge* benefit > here is that it allows you to share .h files between *.dts and C code, > so you don't have to write out the same set of #defines once in dtc > syntax and once in cpp syntax. ... and it imposes an equally *huge* restriction that you have to restrict the .h file to avoid avoid C constructs. That can be done, but I've personally experienced a lot of headaches when trying to share .h files between different languages. >
WARNING: multiple messages have this Message-ID (diff)
From: Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org> To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> Cc: Michal Marek <mmarek-AlSwsSmVLrQ@public.gmane.org>, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: dtc: import latest upstream dtc Date: Wed, 10 Oct 2012 08:56:11 -1000 [thread overview] Message-ID: <5075C4CB.8020409@firmworks.com> (raw) In-Reply-To: <5075C254.4040304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> On 10/10/2012 8:45 AM, Stephen Warren wrote: > On 10/10/2012 12:23 PM, Mitch Bradley wrote: >> On 10/10/2012 7:09 AM, Rob Herring wrote: >>> On 10/09/2012 04:16 PM, Stephen Warren wrote: >>>> On 10/01/2012 12:39 PM, Jon Loeliger wrote: >>>>>> >>>>>> What more do you think needs discussion re: dtc+cpp? >>>>> >>>>> How not to abuse the ever-loving shit out of it? :-) >>>> >>>> Perhaps we can just handle this through the regular patch review >>>> process; I think it may be difficult to define and agree upon exactly >>>> what "abuse" means ahead of time, but it's probably going to be easy >>>> enough to recognize it when one sees it? >>> >>> Rather than repeating things over and over in reviews, we should >>> document at least rules we can easily agree on and then add to it when >>> people get "creative." Also, I can't keep up with every single binding >>> review as is, and this could just add another level of complexity to the >>> review. A few off the top of my head and from the thread discussion: >>> >>> - Headers must be self contained with no outside (i.e. libc, kernel, >>> etc.) header dependencies. >>> - No kernel kconfig option usage >>> - No gcc built-in define usage >>> - No unused items (i.e. externs, structs, etc.) >>> - No macro concatenation >>> - No macros for strings or property names >> >> Instead of making a bunch of rules about how you can only use a small >> subset of cpp, why not just add a "define name value" command to DTC? > > I implemented a patch to do exactly that, and it was rejected because it > only solved part of the problem (named constants) and not the reset (a > completely generic macro language/... within dtc). The argument was that > defining just the named constant syntax on its own without knowing what > the unspecified future macro language will look like might result in the > named constant syntax not fitting into it. > > That all said, I now think that using cpp is actually a much better > solution that adding yet more dtc-specific syntax. The *huge* benefit > here is that it allows you to share .h files between *.dts and C code, > so you don't have to write out the same set of #defines once in dtc > syntax and once in cpp syntax. ... and it imposes an equally *huge* restriction that you have to restrict the .h file to avoid avoid C constructs. That can be done, but I've personally experienced a lot of headaches when trying to share .h files between different languages. >
next prev parent reply other threads:[~2012-10-10 18:56 UTC|newest] Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-09-28 21:25 [PATCH] dtc: import latest upstream dtc Stephen Warren 2012-09-29 21:06 ` Jon Loeliger 2012-10-01 16:09 ` Rob Herring 2012-10-01 16:13 ` Stephen Warren 2012-10-01 16:13 ` Stephen Warren 2012-10-01 17:56 ` Rob Herring 2012-10-01 17:56 ` Rob Herring 2012-10-01 18:33 ` Stephen Warren 2012-10-01 18:39 ` Jon Loeliger 2012-10-01 18:39 ` Jon Loeliger 2012-10-09 21:16 ` Stephen Warren 2012-10-09 21:16 ` Stephen Warren 2012-10-09 23:20 ` Mitch Bradley 2012-10-09 23:20 ` Mitch Bradley 2012-10-10 0:04 ` Scott Wood 2012-10-10 0:04 ` Scott Wood 2012-10-10 4:43 ` Warner Losh 2012-10-10 7:24 ` David Gibson 2012-10-10 14:41 ` Warner Losh 2012-10-10 14:41 ` Warner Losh 2012-10-10 23:06 ` David Gibson 2012-10-10 15:16 ` Stephen Warren 2012-10-10 15:33 ` Rob Herring 2012-10-10 16:19 ` Stephen Warren 2012-10-10 17:18 ` Rob Herring 2012-10-10 18:42 ` Stephen Warren 2012-10-10 23:16 ` David Gibson 2012-10-10 23:16 ` David Gibson 2012-10-11 1:42 ` Mitch Bradley 2012-10-11 5:11 ` David Gibson 2012-10-11 5:11 ` David Gibson 2012-10-10 23:09 ` David Gibson 2012-10-10 23:09 ` David Gibson 2012-10-10 15:15 ` Stephen Warren 2012-10-10 15:15 ` Stephen Warren 2012-10-10 16:09 ` Scott Wood 2012-10-10 16:09 ` Scott Wood 2012-10-10 16:22 ` Stephen Warren 2012-10-10 23:18 ` David Gibson 2012-10-12 17:24 ` Stephen Warren 2012-10-13 6:24 ` David Gibson 2012-10-13 6:24 ` David Gibson 2012-10-13 13:42 ` Segher Boessenkool 2012-10-13 13:42 ` Segher Boessenkool 2012-10-14 0:16 ` David Gibson 2012-10-14 0:16 ` David Gibson 2012-10-10 17:09 ` Rob Herring 2012-10-10 18:23 ` Mitch Bradley 2012-10-10 18:23 ` Mitch Bradley 2012-10-10 18:45 ` Stephen Warren 2012-10-10 18:45 ` Stephen Warren 2012-10-10 18:56 ` Mitch Bradley [this message] 2012-10-10 18:56 ` Mitch Bradley 2012-10-11 0:14 ` David Gibson 2012-10-10 23:54 ` David Gibson 2012-10-10 18:40 ` Stephen Warren 2012-10-10 18:52 ` Mitch Bradley 2012-10-10 18:52 ` Mitch Bradley 2012-10-01 18:02 ` Jon Loeliger 2012-10-01 18:02 ` Jon Loeliger
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=5075C4CB.8020409@firmworks.com \ --to=wmb@firmworks.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mmarek@suse.cz \ --cc=robherring2@gmail.com \ --cc=swarren@nvidia.com \ --cc=swarren@wwwdotorg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.