Re: Toshiba keyboard workaroun

Christoph Hellwig (hch@infradead.org)
Sun, 23 Feb 2003 11:50:12 +0000


On Tue, Feb 18, 2003 at 10:19:40PM +0100, Pavel Machek wrote:
> + /*
> + * Fix for Toshiba Satellites. Toshiba's like to repeat
> + * "key down" event for A in combinations like shift-A.
> + * Thanx to Andrei Pitis <pink@roedu.net>.
> + */
> + static int prev_scancode = 0;
> + static int stop_jiffies = 0;
> +
> + /* new scancode, trigger delay */
> + if (keycode != prev_scancode) stop_jiffies = jiffies;
> + else if (jiffies - stop_jiffies >= 10) stop_jiffies = 0;
> + else {
> + printk( "Keyboard glitch detected, ignoring keypress\n" );
> + return;
> + }
> + prev_scancode = keycode;
> +

That codingstyle is not acceptable. Please reformat to match
Documentation/CodingStyle. Also there are macros for jiffie overflow
handling you might want to use, see include/linux/jiffies.h

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