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

Milton Miller miltonm at bga.com
Thu Oct 25 14:33:14 EST 2007


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.

milton




More information about the Linuxppc-dev mailing list