[PATCH 2.6.22] [resend] Allow PMU LED control on PowerMac 7, 2 and 7, 3

Paul Mackerras paulus at samba.org
Thu Mar 22 22:48:17 EST 2007


Tony Vroon writes:

>  	if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
> -	    strncmp(model, "iBook", strlen("iBook")) != 0) {
> +	    strncmp(model, "iBook", strlen("iBook")) != 0 &&
> +	    strncmp(model, "PowerMac7,2", strlen("PowerMac7,2")) != 0 &&
> +	    strncmp(model, "PowerMac7,3", strlen("PowerMac7,3")) != 0) {

Since we only want to accept "PowerMac7,2" or "PowerMac7,3", and not
any longer strings ("PowerMac7,30" for instance), I think the
comparisons you have added should use strcmp rather than strncmp.

Paul.



More information about the Linuxppc-dev mailing list