Bug in keyboard driver

Alan Cox alan at lxorguk.ukuu.org.uk
Thu May 8 12:20:37 CEST 2008


On Thu, 8 May 2008 10:00:57 +0200 (CEST)
"Diego Fdez. Durán" <diego at goedi.net> wrote:

> 
> On Thu, May 8, 2008 09:08, Sean McNeil wrote:
> > the KEY_PHONE is backwards. It returns up when pushed and down when
> > released. The following change fixes it:
> >
> >  static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id)
> >  {
> >         struct neo1973kbd *neo1973kbd_data = dev_id;
> >
> > -       int key_pressed = !gpio_get_value(irq_to_gpio(irq));
> > +       int key_pressed = !!gpio_get_value(irq_to_gpio(irq));
> 
> Pardon my ignorance, but... double negative? It wouldn't be better:

!! isn't just a double negative in C - its a conversion from integer to
true/false boolean value.

Alan




More information about the openmoko-kernel mailing list