[PATCH 01/11] [POWERPC] Add 'machine: ...' line to common show_cpuinfo()

Marian Balakowicz m8 at semihalf.com
Fri Oct 26 00:47:22 EST 2007


Milton Miller wrote:
> On Wed Oct 24 17:11:29 EST 2007, Stephen Rothwell wrote:
>> On Wed, 24 Oct 2007 01:13:09 +0200 Marian Balakowicz  wrote:
>>> +		root = of_find_node_by_path("/");
>>> +		if (root)
>>> +			model = of_get_property(root, "model", NULL);
>>> +		of_node_put(root);
>> The paranoid part of me says:
>>
>> 		if (model)
>>
>>> +		seq_printf(m, "machine\t\t: %s\n", model);
> 
> My thoughts too (don't fail if no model property in /), and that
> means that
> 
>>> +		const char *model = "";
> 
> can change to  
> +		const char *model = NULL;
> 
> 
> 
> However, a quick grep shows there are several platforms that print
> out machine\t\t: something in show_cpuinfo.  Some are fixed strings
> (eg linkstation, holly, iSeries), some print model with a fallback
> (powermac), some augment the model (chrp, pseries, cell), some print
> something else (52xx/efika).  There are others.  All of those need
> to be dealt with or another tag chosen.

That's true, there is pretty wide range of different approaches. I
would opt for using a different tag and letting the platforms use
their custom machine string if they desire so. How about "model\t\t:
..."? It's not conflicting and self-explanatory too.

Cheers,
m.



More information about the Linuxppc-dev mailing list