From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933535Ab2JKA2p (ORCPT ); Wed, 10 Oct 2012 20:28:45 -0400 Received: from ozlabs.org ([203.10.76.45]:58629 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845Ab2JKA1b (ORCPT ); Wed, 10 Oct 2012 20:27:31 -0400 Date: Thu, 11 Oct 2012 10:09:55 +1100 From: David Gibson To: Stephen Warren Cc: Warner Losh , Scott Wood , Michal Marek , devicetree-discuss@lists.ozlabs.org, Stephen Warren , linux-kernel@vger.kernel.org Subject: Re: dtc: import latest upstream dtc Message-ID: <20121010230955.GF28467@truffula.fritz.box> References: <1349827466.26044.16@snotra> <20121010072401.GA28467@truffula.fritz.box> <50759152.9050407@wwwdotorg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50759152.9050407@wwwdotorg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2012 at 09:16:34AM -0600, Stephen Warren wrote: > On 10/10/2012 01:24 AM, David Gibson wrote: > > On Tue, Oct 09, 2012 at 10:43:50PM -0600, Warner Losh wrote: [snip] > >> .h files include both structs and defines, which are fine for > >> ordinary C code, but problematic in this context. > > > > Right, cpp should be invoked with similar options to the way it's done > > for asm files which have the same problem. I'm not sure if the > > current patch does so. > > That's probably a reasonable idea, although I imagined that people would > actually split out the portions of any header file they wanted to use > with dtc, so that any headers included by *.dts would only include > #defines. Those headers could be used by both dtc and other .h files (or > .c files). Given that header files are right now frequently used in both .c and .S for the #defines, I don't think we can reasonably expect differently for dts files. There certainly is the potential for #include dependency mess, but we cope with it for .S so we can cope with it for dts as well. But cpp should definitely be invoked "asm style" for dts files. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: dtc: import latest upstream dtc Date: Thu, 11 Oct 2012 10:09:55 +1100 Message-ID: <20121010230955.GF28467@truffula.fritz.box> References: <1349827466.26044.16@snotra> <20121010072401.GA28467@truffula.fritz.box> <50759152.9050407@wwwdotorg.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <50759152.9050407-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Stephen Warren Cc: Michal Marek , Stephen Warren , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Scott Wood List-Id: devicetree@vger.kernel.org On Wed, Oct 10, 2012 at 09:16:34AM -0600, Stephen Warren wrote: > On 10/10/2012 01:24 AM, David Gibson wrote: > > On Tue, Oct 09, 2012 at 10:43:50PM -0600, Warner Losh wrote: [snip] > >> .h files include both structs and defines, which are fine for > >> ordinary C code, but problematic in this context. > > > > Right, cpp should be invoked with similar options to the way it's done > > for asm files which have the same problem. I'm not sure if the > > current patch does so. > > That's probably a reasonable idea, although I imagined that people would > actually split out the portions of any header file they wanted to use > with dtc, so that any headers included by *.dts would only include > #defines. Those headers could be used by both dtc and other .h files (or > .c files). Given that header files are right now frequently used in both .c and .S for the #defines, I don't think we can reasonably expect differently for dts files. There certainly is the potential for #include dependency mess, but we cope with it for .S so we can cope with it for dts as well. But cpp should definitely be invoked "asm style" for dts files. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson