Commit 05d97cb2 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Vojtech Pavlik

Input: trailing whitespace fixes

parent 39cc6458
......@@ -106,7 +106,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
}
break;
case EV_ABS:
if (code > ABS_MAX || !test_bit(code, dev->absbit))
......@@ -144,27 +144,27 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
if (code > MSC_MAX || !test_bit(code, dev->mscbit))
return;
if (dev->event) dev->event(dev, type, code, value);
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_LED:
if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value)
return;
change_bit(code, dev->led);
if (dev->event) dev->event(dev, type, code, value);
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_SND:
if (code > SND_MAX || !test_bit(code, dev->sndbit))
return;
if (dev->event) dev->event(dev, type, code, value);
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_REP:
......@@ -181,7 +181,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
break;
}
if (type != EV_SYN)
if (type != EV_SYN)
dev->sync = 0;
if (dev->grab)
......@@ -282,11 +282,11 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
if (id->id.vendor != dev->id.vendor)
continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
if (id->id.product != dev->id.product)
continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
if (id->id.version != dev->id.version)
continue;
......@@ -351,11 +351,11 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
}
if (in_interrupt()) {
printk(KERN_ERR "input.c: calling hotplug from interrupt\n");
return;
return;
}
if (!current->fs->root) {
printk(KERN_WARNING "input.c: calling hotplug without valid filesystem\n");
return;
return;
}
if (!(envp = (char **) kmalloc(20 * sizeof(char *), GFP_KERNEL))) {
printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n");
......@@ -381,17 +381,17 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
envp[i++] = scratch;
scratch += sprintf(scratch, "PRODUCT=%x/%x/%x/%x",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1;
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1;
if (dev->name) {
envp[i++] = scratch;
scratch += sprintf(scratch, "NAME=%s", dev->name) + 1;
scratch += sprintf(scratch, "NAME=%s", dev->name) + 1;
}
if (dev->phys) {
envp[i++] = scratch;
scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1;
}
scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1;
}
SPRINTF_BIT_A(evbit, "EV=", EV_MAX);
SPRINTF_BIT_A2(keybit, "KEY=", KEY_MAX, EV_KEY);
......@@ -506,7 +506,7 @@ void input_register_handler(struct input_handler *handler)
input_table[handler->minor >> 5] = handler;
list_add_tail(&handler->node, &input_handler_list);
list_for_each_entry(dev, &input_dev_list, node)
if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
if ((id = input_match_device(handler->id_table, dev)))
......
......@@ -41,11 +41,11 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
}
if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) {
......
......@@ -40,11 +40,11 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
}
if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) {
......
......@@ -53,11 +53,11 @@ static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned in
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
}
if (value > 20 && value < 32767)
count = 1193182 / value;
spin_lock_irqsave(&beep_lock, flags);
/* EBUS speaker only has on/off state, the frequency does not
......@@ -108,11 +108,11 @@ static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
}
if (value > 20 && value < 32767)
count = 1193182 / value;
spin_lock_irqsave(&beep_lock, flags);
if (count) {
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
*
*
* Changes/Revisions:
* 0.1 20/06/2002
* - first public version
......@@ -68,7 +68,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff
static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id)
{
return 0;
}
}
static int uinput_create_device(struct uinput_device *udev)
{
......@@ -123,7 +123,7 @@ static int uinput_open(struct inode *inode, struct file *file)
memset(newinput, 0, sizeof(struct input_dev));
newdev->dev = newinput;
file->private_data = newdev;
return 0;
......@@ -137,16 +137,16 @@ static int uinput_validate_absbits(struct input_dev *dev)
{
unsigned int cnt;
int retval = 0;
for (cnt = 0; cnt < ABS_MAX; cnt++) {
if (!test_bit(cnt, dev->absbit))
if (!test_bit(cnt, dev->absbit))
continue;
if (/*!dev->absmin[cnt] || !dev->absmax[cnt] || */
(dev->absmax[cnt] <= dev->absmin[cnt])) {
printk(KERN_DEBUG
printk(KERN_DEBUG
"%s: invalid abs[%02x] min:%d max:%d\n",
UINPUT_NAME, cnt,
UINPUT_NAME, cnt,
dev->absmin[cnt], dev->absmax[cnt]);
retval = -EINVAL;
break;
......@@ -154,7 +154,7 @@ static int uinput_validate_absbits(struct input_dev *dev)
if ((dev->absflat[cnt] < dev->absmin[cnt]) ||
(dev->absflat[cnt] > dev->absmax[cnt])) {
printk(KERN_DEBUG
printk(KERN_DEBUG
"%s: absflat[%02x] out of range: %d "
"(min:%d/max:%d)\n",
UINPUT_NAME, cnt, dev->absflat[cnt],
......@@ -190,7 +190,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
goto exit;
}
if (NULL != dev->name)
if (NULL != dev->name)
kfree(dev->name);
size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
......@@ -229,7 +229,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
static ssize_t uinput_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
{
struct uinput_device *udev = file->private_data;
if (test_bit(UIST_CREATED, &(udev->state))) {
struct input_event ev;
......@@ -247,7 +247,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
{
struct uinput_device *udev = file->private_data;
int retval = 0;
if (!test_bit(UIST_CREATED, &(udev->state)))
return -ENODEV;
......@@ -255,16 +255,16 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
return -EAGAIN;
retval = wait_event_interruptible(udev->waitq,
(udev->head != udev->tail) ||
(udev->head != udev->tail) ||
!test_bit(UIST_CREATED, &(udev->state)));
if (retval)
return retval;
if (!test_bit(UIST_CREATED, &(udev->state)))
return -ENODEV;
while ((udev->head != udev->tail) &&
while ((udev->head != udev->tail) &&
(retval + sizeof(struct input_event) <= count)) {
if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]),
sizeof(struct input_event))) return -EFAULT;
......@@ -284,7 +284,7 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait)
if (udev->head != udev->tail)
return POLLIN | POLLRDNORM;
return 0;
return 0;
}
static int uinput_burn_device(struct uinput_device *udev)
......@@ -318,7 +318,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
case UI_DEV_CREATE:
retval = uinput_create_device(udev);
break;
case UI_DEV_DESTROY:
retval = uinput_destroy_device(udev);
break;
......@@ -330,7 +330,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->evbit);
break;
case UI_SET_KEYBIT:
if (arg > KEY_MAX) {
retval = -EINVAL;
......@@ -338,7 +338,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->keybit);
break;
case UI_SET_RELBIT:
if (arg > REL_MAX) {
retval = -EINVAL;
......@@ -346,7 +346,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->relbit);
break;
case UI_SET_ABSBIT:
if (arg > ABS_MAX) {
retval = -EINVAL;
......@@ -354,7 +354,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->absbit);
break;
case UI_SET_MSCBIT:
if (arg > MSC_MAX) {
retval = -EINVAL;
......@@ -362,7 +362,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->mscbit);
break;
case UI_SET_LEDBIT:
if (arg > LED_MAX) {
retval = -EINVAL;
......@@ -370,7 +370,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->ledbit);
break;
case UI_SET_SNDBIT:
if (arg > SND_MAX) {
retval = -EINVAL;
......@@ -378,7 +378,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->sndbit);
break;
case UI_SET_FFBIT:
if (arg > FF_MAX) {
retval = -EINVAL;
......@@ -386,7 +386,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
set_bit(arg, udev->dev->ffbit);
break;
default:
retval = -EFAULT;
}
......
......@@ -124,7 +124,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
memset(gunze, 0, sizeof(struct gunze));
init_input_dev(&gunze->dev);
gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
......
/*
* $Id: h3600_ts_input.c,v 1.4 2002/01/23 06:39:37 jsimmons Exp $
*
* Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com
* Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com
*
* Sponsored by Transvirtual Technology.
*
* Derived from the code in h3600_ts.[ch] by Charles Flynn
* Sponsored by Transvirtual Technology.
*
* Derived from the code in h3600_ts.[ch] by Charles Flynn
*/
/*
......@@ -75,7 +75,7 @@
#define MAX_ID 14
#define H3600_MAX_LENGTH 16
#define H3600_KEY 0xf
#define H3600_KEY 0xf
#define H3600_SCANCODE_RECORD 1 /* 1 -> record button */
#define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */
......@@ -118,13 +118,13 @@ static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1;
struct input_dev *dev = (struct input_dev *) dev_id;
/*
* This interrupt is only called when we release the key. So we have
/*
* This interrupt is only called when we release the key. So we have
* to fake a key press.
*/
*/
input_regs(dev, regs);
input_report_key(dev, KEY_SUSPEND, 1);
input_report_key(dev, KEY_SUSPEND, down);
input_report_key(dev, KEY_SUSPEND, down);
input_sync(dev);
}
......@@ -144,18 +144,18 @@ unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr)
unsigned char brightness = ((pwr==FLITE_PWR_OFF) ? 0:flite_brightness);
struct h3600_dev *ts = dev->private;
/* Must be in this order */
/* Must be in this order */
ts->serio->write(ts->serio, 1);
ts->serio->write(ts->serio, pwr);
ts->serio->write(ts->serio, brightness);
ts->serio->write(ts->serio, brightness);
return 0;
}
static int suspended = 0;
static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
void *data)
{
struct input_dev *dev = (struct input_dev *) data;
struct input_dev *dev = (struct input_dev *) data;
switch (req) {
case PM_SUSPEND: /* enter D1-D3 */
......@@ -183,7 +183,7 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
/*
* This function translates the native event packets to linux input event
* packets. Some packets coming from serial are not touchscreen related. In
* this case we send them off to be processed elsewhere.
* this case we send them off to be processed elsewhere.
*/
static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
{
......@@ -206,7 +206,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
Note: This is true for non interrupt generated key events.
*/
case KEYBD_ID:
down = (ts->buf[0] & 0x80) ? 0 : 1;
down = (ts->buf[0] & 0x80) ? 0 : 1;
switch (ts->buf[0] & 0x7f) {
case H3600_SCANCODE_RECORD:
......@@ -218,7 +218,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
case H3600_SCANCODE_CONTACTS:
key = KEY_PROG2;
break;
case H3600_SCANCODE_Q:
case H3600_SCANCODE_Q:
key = KEY_Q;
break;
case H3600_SCANCODE_START:
......@@ -237,9 +237,9 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
key = KEY_DOWN;
break;
default:
key = 0;
}
if (key)
key = 0;
}
if (key)
input_report_key(dev, key, down);
break;
/*
......@@ -251,13 +251,13 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
* byte 0 1 2 3
*/
case TOUCHS_ID:
if (!touched) {
if (!touched) {
input_report_key(dev, BTN_TOUCH, 1);
touched = 1;
}
}
if (ts->len) {
unsigned short x, y;
unsigned short x, y;
x = ts->buf[0]; x <<= 8; x += ts->buf[1];
y = ts->buf[2]; y <<= 8; y += ts->buf[3];
......@@ -267,7 +267,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
} else {
input_report_key(dev, BTN_TOUCH, 0);
touched = 0;
}
}
break;
default:
/* Send a non input event elsewhere */
......@@ -280,7 +280,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
/*
* h3600ts_event() handles events from the input module.
*/
static int h3600ts_event(struct input_dev *dev, unsigned int type,
static int h3600ts_event(struct input_dev *dev, unsigned int type,
unsigned int code, int value)
{
struct h3600_dev *ts = dev->private;
......@@ -290,7 +290,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type,
// ts->serio->write(ts->serio, SOME_CMD);
return 0;
}
}
}
return -1;
}
......@@ -323,12 +323,12 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data,
struct h3600_dev *ts = serio->private;
/*
* We have a new frame coming in.
* We have a new frame coming in.
*/
switch (state) {
case STATE_SOF:
if (data == CHAR_SOF)
state = STATE_ID;
state = STATE_ID;
return;
case STATE_ID:
ts->event = (data & 0xf0) >> 4;
......@@ -344,7 +344,7 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data,
case STATE_DATA:
ts->chksum += data;
ts->buf[ts->idx]= data;
if(++ts->idx == ts->len)
if(++ts->idx == ts->len)
state = STATE_EOF;
break;
case STATE_EOF:
......@@ -382,7 +382,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
set_GPIO_IRQ_edge( GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE );
if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
"h3600_action", &ts->dev)) {
printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
kfree(ts);
......@@ -390,7 +390,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
}
if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
"h3600_suspend", &ts->dev)) {
free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
......@@ -400,7 +400,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
/* Now we have things going we setup our input device */
ts->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR);
ts->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
ts->dev.ledbit[0] = BIT(LED_SLEEP);
ts->dev.ledbit[0] = BIT(LED_SLEEP);
ts->dev.absmin[ABS_X] = 60; ts->dev.absmin[ABS_Y] = 35;
ts->dev.absmax[ABS_X] = 985; ts->dev.absmax[ABS_Y] = 1024;
......@@ -442,7 +442,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
//h3600_flite_control(1, 25); /* default brightness */
#ifdef CONFIG_PM
ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT,
ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT,
h3600ts_pm_callback);
printk("registered pm callback\n");
#endif
......@@ -458,7 +458,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
static void h3600ts_disconnect(struct serio *serio)
{
struct h3600_dev *ts = serio->private;
free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, &ts->dev);
input_unregister_device(&ts->dev);
......
......@@ -655,7 +655,7 @@ struct ff_periodic_effect {
struct ff_envelope envelope;
/* Only used if waveform == FF_CUSTOM */
__u32 custom_len; /* Number of samples */
__u32 custom_len; /* Number of samples */
__s16 *custom_data; /* Buffer of samples */
/* Note: the data pointed by custom_data is copied by the driver. You can
* therefore dispose of the memory after the upload/update */
......
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