[PATCH 2/2] powerpc/85xx: p1022ds: enable monitor switching via pixis indirect mode

Timur Tabi timur at freescale.com
Fri Nov 18 09:09:17 EST 2011


Stephen Rothwell wrote:

>>  static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port)
>>  {
>> -	struct device_node *np;
>> -	void __iomem *pixis;
>> -	u8 __iomem *brdcfg1;
>> +	struct device_node *guts_node = NULL;
> 
> There is no point in initialising this as it is assigned before being
> used.

Ok.

>> +	struct device_node *indirect_node = NULL;
>> +	struct ccsr_guts_85xx __iomem *guts = NULL;
>> +	u8 __iomem *lbc_lcs0_ba = NULL;
>> +	u8 __iomem *lbc_lcs1_ba = NULL;
> 
> And if you had multiple error path labels, you could avoid these others
> as well (and the NULL checks on the error path).

But I don't want multiple error path labels.  The error path could only happen if someone passed in a broken device tree (i.e. pretty much never), so I'm not keen on complicating my code just to optimize something that will never be used.

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Linuxppc-dev mailing list