[PATCH 1/19] PCI: rpaphp: Cleanup flow of control for rpaphp_add_slot

Linas Vepstas linas at austin.ibm.com
Wed Apr 4 02:00:26 EST 2007


On Tue, Apr 03, 2007 at 09:28:28AM -0500, Nathan Lynch wrote:
> Linas Vepstas wrote:
> > 
> > Cleanup the flow of control for rpaphp_add_slot(), so as to
> > make it easier to read. The ext patch will fix a bug in this 
> > same code. 
> 
> This:
> 
> > +	if (!dn || strcmp(dn->name, "pci"))
> > +		return 0;
> 
> is not equivalent to the code it's replacing:
> 
> > -	if (dn->name != 0 && strcmp(dn->name, "pci") == 0) {
> 
> With your version we'll oops if dn->name is NULL.

oops, thanks, I'll fix that.

--linas



More information about the Linuxppc-dev mailing list