]> err.no Git - linux-2.6/commitdiff
Input: atkbd - fix complaints about 'releasing unknown key 0x7f'
authorVojtech Pavlik <vojtech@suse.cz>
Tue, 14 Mar 2006 05:09:52 +0000 (00:09 -0500)
committerDmitry Torokhov <dtor_core@ameritech.net>
Tue, 14 Mar 2006 05:09:52 +0000 (00:09 -0500)
Fix bat_xl and err_xl logic causing atkbd to complain about 'unknown
key 0x7f'. Noted by Ben LaHaise.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/atkbd.c

index b45981870c7a6e31ce9bfcfdd6cecaa1051155b2..7d26ab4818b287c2d6346425a0a771954fdb1ded 100644 (file)
@@ -303,19 +303,19 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
        if (atkbd->translated) {
 
                if (atkbd->emul ||
-                   !(code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1 ||
-                     code == ATKBD_RET_HANGUEL || code == ATKBD_RET_HANJA ||
-                    (code == ATKBD_RET_ERR && !atkbd->err_xl) ||
-                    (code == ATKBD_RET_BAT && !atkbd->bat_xl))) {
+                   (code != ATKBD_RET_EMUL0 && code != ATKBD_RET_EMUL1 &&
+                    code != ATKBD_RET_HANGUEL && code != ATKBD_RET_HANJA &&
+                    (code != ATKBD_RET_ERR || atkbd->err_xl) &&
+                    (code != ATKBD_RET_BAT || atkbd->bat_xl))) {
                        atkbd->release = code >> 7;
                        code &= 0x7f;
                }
 
                if (!atkbd->emul) {
                     if ((code & 0x7f) == (ATKBD_RET_BAT & 0x7f))
-                       atkbd->bat_xl = !atkbd->release;
+                       atkbd->bat_xl = !(data >> 7);
                     if ((code & 0x7f) == (ATKBD_RET_ERR & 0x7f))
-                       atkbd->err_xl = !atkbd->release;
+                       atkbd->err_xl = !(data >> 7);
                }
        }