[patch] Small input fixes for 2.5.29 [2/2]

Vojtech Pavlik
2002-07-30T10:26:01Z

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.527, 2002-07-30 11:54:26+02:00, vojtech@suse.cz
This simplifies the software autorepeat code in input/input.c,
also killing a race which could be the cause of autorepeat not
stopping after a key was released.

===================================================================

input.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)

===================================================================

diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c Tue Jul 30 12:26:59 2002
+++ b/drivers/input/input.c Tue Jul 30 12:26:59 2002
@@ -100,18 +100,14 @@
if (code > KEY_MAX || !test_bit(code, dev->keybit) || !!test_bit(code, dev->key) == value)
return;

- if (value == 2) break;
+ if (value == 2)
+ break;

change_bit(code, dev->key);

- if (test_bit(EV_REP, dev->evbit) && dev->timer.function) {
- if (value) {
- mod_timer(&dev->timer, jiffies + dev->rep[REP_DELAY]);
- dev->repeat_key = code;
- break;
- }
- if (dev->repeat_key == code)
- del_timer(&dev->timer);
+ if (test_bit(EV_REP, dev->evbit) && value) {
+ dev->repeat_key = code;
+ mod_timer(&dev->timer, jiffies + dev->rep[REP_DELAY]);
}

break;
@@ -204,8 +200,13 @@
static void input_repeat_key(unsigned long data)
{
struct input_dev *dev = (void *) data;
+
+ if (!test_bit(dev->repeat_key, dev->key))
+ return;
+
input_event(dev, EV_KEY, dev->repeat_key, 2);
input_sync(dev);
+
mod_timer(&dev->timer, jiffies + dev->rep[REP_PERIOD]);
}

@@ -268,6 +269,7 @@
*
* Returns nothing.
*/
+
#define input_find_and_remove(type, initval, targ, next) \
do { \
type **ptr; \
@@ -513,7 +515,7 @@
* Kill any pending repeat timers.
*/

- del_timer(&dev->timer);
+ del_timer_sync(&dev->timer);

/*
* Notify handlers.

===================================================================

This BitKeeper patch contains the following changesets:
1.527
## Wrapped with gzip_uu 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