[PATCH 1/3] powerpc: Clean up pSeries firmware feature initialisation

Nathan Lynch ntl at pobox.com
Thu Feb 9 18:23:32 EST 2006


Michael Ellerman wrote:

...

>  	DBG(" -> fw_feature_init()\n");
>  
> -	ppc64_firmware_features = 0;
>  	dn = of_find_node_by_path("/rtas");
>  	if (dn == NULL) {
> -		printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n");
> +		printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n");
>  		goto no_rtas;
>  	}
>  
>  	hypertas = get_property(dn, "ibm,hypertas-functions", &len);
> -	if (hypertas) {
> -		while (len > 0){
> -			int i, hypertas_len;
> +	if (hypertas == NULL)
> +		goto no_hypertas;

...

> +no_hypertas:
>  	of_node_put(dn);
>  no_rtas:
> -
>  	DBG(" <- fw_feature_init()\n");
>  }

of_node_put can handle a null pointer fine, so you could get away with
just one label here.




More information about the Linuxppc64-dev mailing list