/* q40kbd_flush() flushes all data that may be in the keyboard buffers  */
static void q40kbd_flush(void)
/* q40kbd_flush() flushes all data that may be in the keyboard buffers  */
static void q40kbd_flush(void)
{
	int maxread = 100;
	unsigned long flags;
	spin_lock_irqsave(&q40kbd_lock, flags);
	while (maxread-- && (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)))
		master_inb(KEYCODE_REG);
	spin_unlock_irqrestore(&q40kbd_lock, flags);
}