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

Nathan Lynch ntl at pobox.com
Wed Apr 4 00:28:28 EST 2007


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.



More information about the Linuxppc-dev mailing list