From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC PATCH 2/2] ARM: DT: kernel: DT cpu node bindings update Date: Tue, 16 Apr 2013 18:21:08 +0200 Message-ID: <1366129268.24994.60.camel@pasglop> References: <1366042402-8987-1-git-send-email-lorenzo.pieralisi@arm.com> <1366042402-8987-3-git-send-email-lorenzo.pieralisi@arm.com> <516C544A.4090107@wwwdotorg.org> <20130416104545.GA19837@e102568-lin.cambridge.arm.com> <516D74E9.9030404@wwwdotorg.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <516D74E9.9030404@wwwdotorg.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stephen Warren Cc: Nicolas Pitre , Jon Medhurst , Dave Martin , Andrew Lunn , Tony Lindgren , Catalin Marinas , Linus Walleij , Sekhar Nori , Grant Likely , Kukjin Kim , Mark Rutland , Lennert Buytenhek , Lorenzo Pieralisi , Russell King , Magnus Damm , Viresh Kumar , David Brown , Dinh Nguyen , Arnd Bergmann , "devicetree-discuss@lists.ozlabs.org" , "rob.herring@calxeda.com" , Simon Horman , Barr List-Id: devicetree@vger.kernel.org On Tue, 2013-04-16 at 09:57 -0600, Stephen Warren wrote: > > Mmm, I need to read more on dtc+cpp, I do not think that leaving it > > as a string would hurt though, am I wrong ? Can we assume that all > dts > > are preprocessed before being compiled and passed to the kernel ? > > It wouldn't hurt too much, but representing enums as strings when > there's a capability to simply represent it as a integer just feels > pretty gross to me. It's the other way around... Unless there's a direct semantic meaning of the numbers, things like that (ie. "methods") should be represented as strings. Else we fall back to the realm of "magic numbers" which sucks and causes all sort of pains when several new methods get added by different people, etc... The tree is meant to be generally human readable and we should stick to that. The tiny memory usage is irrelevant on any modern setup. Cheers, Ben.