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

From: Timur Tabi <[email-masked]>
Date: Thu, 17 Nov 2011 16:09:17 -0600

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