Re: [PATCH] PS/2 mouse rate setting

From: Linus Torvalds
Date: Mon Oct 27 2003 - 13:57:50 EST



On Mon, 27 Oct 2003, Andi Kleen wrote:
> static void psmouse_set_rate(struct psmouse *psmouse)
> {
> - unsigned char rates[] = { 200, 100, 80, 60, 40, 20, 10, 0 };
> + static unsigned char rates[] = { 200, 100, 80, 60, 40, 20, 10, 0 };
> int i = 0;
>
> - while (rates[i] > psmouse_rate) i++;
> + if (!psmouse_rate)
> + return;
> +
> + while (rates[i] >= psmouse_rate) i++;

Ok, explain that ">=" to me. It looked more right the way it used to be.

In particular, if you want a rate of 200, you will now make "i" be _1_, so
we send a command to set the rate to 100.

Which makes no sense.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/