diff options
| author | Linus Torvalds <torvalds@home.osdl.org> | 2004-02-08 03:02:20 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-02-08 03:02:20 -0800 |
| commit | a6eebfd5c5e94e2d94a672407795e2d1a9045315 (patch) | |
| tree | 766b3391aa70ecf495830b7aa728476fab42a09a /drivers | |
| parent | 2da321321f6ee9541391fd02aa605e49e3309eb0 (diff) | |
Make SET_INPUT_KEYCODE return the old value, and clean up
users of this that were very confused indeed.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/char/keyboard.c | 3 | ||||
| -rw-r--r-- | drivers/input/evdev.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 643014bf8c4c..010bff6e1449 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -201,8 +201,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode) if (scancode < 0 || scancode >= dev->keycodemax) return -EINVAL; - oldkey = INPUT_KEYCODE(dev, scancode); - SET_INPUT_KEYCODE(dev, scancode, oldkey); + oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); clear_bit(oldkey, dev->keybit); set_bit(keycode, dev->keybit); diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 0e16eeeb9e55..9b26ff99a414 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -209,7 +209,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, struct evdev *evdev = list->evdev; struct input_dev *dev = evdev->handle.dev; struct input_absinfo abs; - int i, t, u, v; + int t, u, v; if (!evdev->exist) return -ENODEV; @@ -231,10 +231,8 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (get_user(t, ((int *) arg) + 0)) return -EFAULT; if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL; if (get_user(v, ((int *) arg) + 1)) return -EFAULT; - u = INPUT_KEYCODE(dev, t); - SET_INPUT_KEYCODE(dev, t, v); - for (i = 0; i < dev->keycodemax; i++) if (v == u) break; - if (i == dev->keycodemax) clear_bit(u, dev->keybit); + u = SET_INPUT_KEYCODE(dev, t, v); + clear_bit(u, dev->keybit); set_bit(v, dev->keybit); return 0; |
