Bug in keyboard driver

Sean McNeil sean at mcneil.com
Thu May 8 10:24:18 CEST 2008


Diego Fdez. Durán 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:
>
>           int key_pressed = gpio_get_value(irq_to_gpio(irq));
>
> ?
>   
I was uncertain what the value is that gets returned. If it is 0 or 1, 
then yes it would be better to not do a !!. If it returns other than 0 
or 1 then it needs to be modified.





More information about the openmoko-kernel mailing list