From mboxrd@z Thu Jan 1 00:00:00 1970 From: robherring2@gmail.com (Rob Herring) Date: Mon, 28 Oct 2013 18:58:22 -0500 Subject: [PATCH] ARM: remove name from machine_desc for DT platforms In-Reply-To: <526EC0B8.2080307@wwwdotorg.org> References: <1381352107-32464-1-git-send-email-robherring2@gmail.com> <526EC0B8.2080307@wwwdotorg.org> Message-ID: <526EFA1E.5050008@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 10/28/2013 02:53 PM, Stephen Warren wrote: > On 10/26/2013 09:34 AM, Rob Herring wrote: >> On Wed, Oct 9, 2013 at 3:55 PM, Rob Herring wrote: >>> From: Rob Herring >>> >>> As part of the effort to ultimately remove struct machine_desc, the >>> machine name is not really needed. It is only used for /proc/cpuinfo >>> "Hardware" field. Get this information from the DT instead and remove >>> the name string in the machine descriptor for DT machine descriptors. The >>> model or machine compatible property from the DT is used instead. >>> >>> This likely changes the name reported by /proc/cpuinfo. There could be >>> some userspace dependencies on the old name. Debian libdebian-installer >>> used to use this to determine kernel flavour, but now uses the DT >>> directly. It is not really a good idea for userspace to depend on this >>> anyway. > >>> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c >>> index 0e1e2b3..b0747bb 100644 >>> --- a/arch/arm/kernel/setup.c >>> +++ b/arch/arm/kernel/setup.c >>> @@ -611,7 +611,7 @@ void __init dump_machine_table(void) >>> >>> early_print("Available machine support:\n\nID (hex)\tNAME\n"); >>> for_each_machine_desc(p) >>> - early_print("%08x\t%s\n", p->nr, p->name); >>> + early_print("%08x\t%s\n", p->nr, p->name ? p->name : *p->dt_compat); > > Does it make sense to iterate over all the entries in p->dt_compat here? > Tegra's machine descriptor supports 4 different compatible values, and I > think that'll only print one of them. This is simply showing which machines are built into the kernel. With only the first string, you can figure out the other strings. It is not much of a different lookup than before. Considering you need DEBUG_LL enabled to see any of this to begin with, I don't think that's too much of a hurdle. Rob