[PATCH] driver/FSL SATA:Fix wrong Device Error Register usage

David Laight David.Laight at ACULAB.COM
Fri Feb 18 19:41:44 EST 2011


 
> +			if ((ffs(dereg)-1) < ap->nr_pmp_links) {
> +				/* array start from 0 */
> +				link = &ap->pmp_link[ffs(dereg)-1];

I'd only call ffs() once - it could be a slow library function.
Any comment should note that ffs() returns 0 when no bits
are set - rather than anything about array indexes.

	David




More information about the Linuxppc-dev mailing list