Commit 4081c205 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Vojtech Pavlik

Input: trailing whitespace fixes in drivers/input

parent 8810dcdc
...@@ -11,18 +11,18 @@ ...@@ -11,18 +11,18 @@
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Should you need to contact me, the author, you can do so either by * Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <linux/device.h> #include <linux/device.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Input driver event debug module"); MODULE_DESCRIPTION("Input driver event debug module");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static char evbug_name[] = "evbug"; static char evbug_name[] = "evbug";
...@@ -67,7 +67,7 @@ static struct input_handle *evbug_connect(struct input_handler *handler, struct ...@@ -67,7 +67,7 @@ static struct input_handle *evbug_connect(struct input_handler *handler, struct
static void evbug_disconnect(struct input_handle *handle) static void evbug_disconnect(struct input_handle *handle)
{ {
printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", handle->dev->phys); printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", handle->dev->phys);
input_close_device(handle); input_close_device(handle);
kfree(handle); kfree(handle);
...@@ -79,7 +79,7 @@ static struct input_device_id evbug_ids[] = { ...@@ -79,7 +79,7 @@ static struct input_device_id evbug_ids[] = {
}; };
MODULE_DEVICE_TABLE(input, evbug_ids); MODULE_DEVICE_TABLE(input, evbug_ids);
static struct input_handler evbug_handler = { static struct input_handler evbug_handler = {
.event = evbug_event, .event = evbug_event,
.connect = evbug_connect, .connect = evbug_connect,
......
...@@ -220,7 +220,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -220,7 +220,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case EVIOCGID: case EVIOCGID:
return copy_to_user((void *) arg, &dev->id, sizeof(struct input_id)) ? -EFAULT : 0; return copy_to_user((void *) arg, &dev->id, sizeof(struct input_id)) ? -EFAULT : 0;
case EVIOCGKEYCODE: case EVIOCGKEYCODE:
if (get_user(t, ((int *) arg) + 0)) return -EFAULT; if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL; if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
...@@ -428,7 +428,7 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct ...@@ -428,7 +428,7 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct
devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor); S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor);
class_simple_device_add(input_class, class_simple_device_add(input_class,
MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
dev->dev, "event%d", minor); dev->dev, "event%d", minor);
......
/* /*
* Joystick device driver for the input driver suite. * Joystick device driver for the input driver suite.
* *
* Copyright (c) 1999-2002 Vojtech Pavlik * Copyright (c) 1999-2002 Vojtech Pavlik
* Copyright (c) 1999 Colin Van Dyke * Copyright (c) 1999 Colin Van Dyke
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
*/ */
...@@ -34,7 +34,7 @@ MODULE_SUPPORTED_DEVICE("input/js"); ...@@ -34,7 +34,7 @@ MODULE_SUPPORTED_DEVICE("input/js");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define JOYDEV_MINOR_BASE 0 #define JOYDEV_MINOR_BASE 0
#define JOYDEV_MINORS 16 #define JOYDEV_MINORS 16
#define JOYDEV_BUFFER_SIZE 64 #define JOYDEV_BUFFER_SIZE 64
#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) #define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
...@@ -115,7 +115,7 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne ...@@ -115,7 +115,7 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne
default: default:
return; return;
} }
event.time = MSECS(jiffies); event.time = MSECS(jiffies);
...@@ -449,10 +449,10 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct ...@@ -449,10 +449,10 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
} }
joydev_table[minor] = joydev; joydev_table[minor] = joydev;
devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor); S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
class_simple_device_add(input_class, class_simple_device_add(input_class,
MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
dev->dev, "js%d", minor); dev->dev, "js%d", minor);
...@@ -466,7 +466,7 @@ static void joydev_disconnect(struct input_handle *handle) ...@@ -466,7 +466,7 @@ static void joydev_disconnect(struct input_handle *handle)
joydev->exist = 0; joydev->exist = 0;
if (joydev->open) if (joydev->open)
input_close_device(handle); input_close_device(handle);
else else
joydev_free(joydev); joydev_free(joydev);
} }
......
...@@ -177,7 +177,7 @@ static void mousedev_event(struct input_handle *handle, unsigned int type, unsig ...@@ -177,7 +177,7 @@ static void mousedev_event(struct input_handle *handle, unsigned int type, unsig
case BTN_SIDE: if (list->mode == 2) { index = 3; break; } case BTN_SIDE: if (list->mode == 2) { index = 3; break; }
case BTN_2: case BTN_2:
case BTN_STYLUS2: case BTN_STYLUS2:
case BTN_MIDDLE: index = 2; break; case BTN_MIDDLE: index = 2; break;
default: return; default: return;
} }
switch (value) { switch (value) {
...@@ -267,7 +267,7 @@ static int mousedev_release(struct inode * inode, struct file * file) ...@@ -267,7 +267,7 @@ static int mousedev_release(struct inode * inode, struct file * file)
mousedev_free(list->mousedev); mousedev_free(list->mousedev);
} }
} }
kfree(list); kfree(list);
return 0; return 0;
} }
...@@ -301,11 +301,11 @@ static int mousedev_open(struct inode * inode, struct file * file) ...@@ -301,11 +301,11 @@ static int mousedev_open(struct inode * inode, struct file * file)
if (list->mousedev->minor == MOUSEDEV_MIX) { if (list->mousedev->minor == MOUSEDEV_MIX) {
list_for_each_entry(handle, &mousedev_handler.h_list, h_node) { list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
mousedev = handle->private; mousedev = handle->private;
if (!mousedev->open && mousedev->exist) if (!mousedev->open && mousedev->exist)
input_open_device(handle); input_open_device(handle);
} }
} else } else
if (!mousedev_mix.open && list->mousedev->exist) if (!mousedev_mix.open && list->mousedev->exist)
input_open_device(&list->mousedev->handle); input_open_device(&list->mousedev->handle);
} }
...@@ -327,7 +327,7 @@ static void mousedev_packet(struct mousedev_list *list, unsigned char off) ...@@ -327,7 +327,7 @@ static void mousedev_packet(struct mousedev_list *list, unsigned char off)
list->ps2[off + 3] = (list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18) << 1); list->ps2[off + 3] = (list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18) << 1);
list->bufsiz++; list->bufsiz++;
} }
if (list->mode == 1) { if (list->mode == 1) {
list->ps2[off + 3] = (list->dz > 127 ? 127 : (list->dz < -127 ? -127 : list->dz)); list->ps2[off + 3] = (list->dz > 127 ? 127 : (list->dz < -127 ? -127 : list->dz));
list->dz -= list->ps2[off + 3]; list->dz -= list->ps2[off + 3];
...@@ -403,7 +403,7 @@ static ssize_t mousedev_write(struct file * file, const char * buffer, size_t co ...@@ -403,7 +403,7 @@ static ssize_t mousedev_write(struct file * file, const char * buffer, size_t co
kill_fasync(&list->fasync, SIGIO, POLL_IN); kill_fasync(&list->fasync, SIGIO, POLL_IN);
wake_up_interruptible(&list->mousedev->wait); wake_up_interruptible(&list->mousedev->wait);
return count; return count;
} }
...@@ -431,7 +431,7 @@ static ssize_t mousedev_read(struct file * file, char * buffer, size_t count, lo ...@@ -431,7 +431,7 @@ static ssize_t mousedev_read(struct file * file, char * buffer, size_t count, lo
if (copy_to_user(buffer, list->ps2 + list->bufsiz - list->buffer - count, count)) if (copy_to_user(buffer, list->ps2 + list->bufsiz - list->buffer - count, count))
return -EFAULT; return -EFAULT;
return count; return count;
} }
/* No kernel lock - fine */ /* No kernel lock - fine */
...@@ -487,7 +487,7 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru ...@@ -487,7 +487,7 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru
devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor), devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor); S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor);
class_simple_device_add(input_class, class_simple_device_add(input_class,
MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor), MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
dev->dev, "mouse%d", minor); dev->dev, "mouse%d", minor);
...@@ -538,7 +538,7 @@ static struct input_device_id mousedev_ids[] = { ...@@ -538,7 +538,7 @@ static struct input_device_id mousedev_ids[] = {
}; };
MODULE_DEVICE_TABLE(input, mousedev_ids); MODULE_DEVICE_TABLE(input, mousedev_ids);
static struct input_handler mousedev_handler = { static struct input_handler mousedev_handler = {
.event = mousedev_event, .event = mousedev_event,
.connect = mousedev_connect, .connect = mousedev_connect,
......
/* /*
* $Id: power.c,v 1.10 2001/09/25 09:17:15 vojtech Exp $ * $Id: power.c,v 1.10 2001/09/25 09:17:15 vojtech Exp $
* *
* Copyright (c) 2001 "Crazy" James Simmons * Copyright (c) 2001 "Crazy" James Simmons
* *
* Input driver Power Management. * Input driver Power Management.
* *
...@@ -51,7 +51,7 @@ static void suspend_button_task_handler(void *data) ...@@ -51,7 +51,7 @@ static void suspend_button_task_handler(void *data)
static DECLARE_WORK(suspend_button_task, suspend_button_task_handler, NULL); static DECLARE_WORK(suspend_button_task, suspend_button_task_handler, NULL);
static void power_event(struct input_handle *handle, unsigned int type, static void power_event(struct input_handle *handle, unsigned int type,
unsigned int code, int down) unsigned int code, int down)
{ {
struct input_dev *dev = handle->dev; struct input_dev *dev = handle->dev;
...@@ -73,7 +73,7 @@ static void power_event(struct input_handle *handle, unsigned int type, ...@@ -73,7 +73,7 @@ static void power_event(struct input_handle *handle, unsigned int type,
case KEY_POWER: case KEY_POWER:
/* Hum power down the machine. */ /* Hum power down the machine. */
break; break;
default: default:
return; return;
} }
} else { } else {
...@@ -83,9 +83,9 @@ static void power_event(struct input_handle *handle, unsigned int type, ...@@ -83,9 +83,9 @@ static void power_event(struct input_handle *handle, unsigned int type,
/* This is risky. See pm.h for details. */ /* This is risky. See pm.h for details. */
if (dev->state != PM_RESUME) if (dev->state != PM_RESUME)
dev->state = PM_RESUME; dev->state = PM_RESUME;
else else
dev->state = PM_SUSPEND; dev->state = PM_SUSPEND;
pm_send(dev->pm_dev, dev->state, dev); pm_send(dev->pm_dev, dev->state, dev);
break; break;
case KEY_POWER: case KEY_POWER:
/* Turn the input device off completely ? */ /* Turn the input device off completely ? */
...@@ -97,14 +97,14 @@ static void power_event(struct input_handle *handle, unsigned int type, ...@@ -97,14 +97,14 @@ static void power_event(struct input_handle *handle, unsigned int type,
return; return;
} }
static struct input_handle *power_connect(struct input_handler *handler, static struct input_handle *power_connect(struct input_handler *handler,
struct input_dev *dev, struct input_dev *dev,
struct input_device_id *id) struct input_device_id *id)
{ {
struct input_handle *handle; struct input_handle *handle;
if (!test_bit(EV_KEY, dev->evbit) || !test_bit(EV_PWR, dev->evbit)) if (!test_bit(EV_KEY, dev->evbit) || !test_bit(EV_PWR, dev->evbit))
return NULL; return NULL;
if (!test_bit(KEY_SUSPEND, dev->keybit) || (!test_bit(KEY_POWER, dev->keybit))) if (!test_bit(KEY_SUSPEND, dev->keybit) || (!test_bit(KEY_POWER, dev->keybit)))
return NULL; return NULL;
...@@ -133,21 +133,21 @@ static struct input_device_id power_ids[] = { ...@@ -133,21 +133,21 @@ static struct input_device_id power_ids[] = {
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT(EV_KEY) }, .evbit = { BIT(EV_KEY) },
.keybit = { [LONG(KEY_SUSPEND)] = BIT(KEY_SUSPEND) } .keybit = { [LONG(KEY_SUSPEND)] = BIT(KEY_SUSPEND) }
}, },
{ {
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT(EV_KEY) }, .evbit = { BIT(EV_KEY) },
.keybit = { [LONG(KEY_POWER)] = BIT(KEY_POWER) } .keybit = { [LONG(KEY_POWER)] = BIT(KEY_POWER) }
}, },
{ {
.flags = INPUT_DEVICE_ID_MATCH_EVBIT, .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_PWR) }, .evbit = { BIT(EV_PWR) },
}, },
{ }, /* Terminating entry */ { }, /* Terminating entry */
}; };
MODULE_DEVICE_TABLE(input, power_ids); MODULE_DEVICE_TABLE(input, power_ids);
static struct input_handler power_handler = { static struct input_handler power_handler = {
.event = power_event, .event = power_event,
.connect = power_connect, .connect = power_connect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment