[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1343200277-14385-1-git-send-email-chenbdchenbd@gmail.com>
Date: Wed, 25 Jul 2012 15:11:17 +0800
From: Baodong Chen <chenbdchenbd@...il.com>
To: dmitry.torokhov@...il.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Baodong Chen <chenbdchenbd@...il.com>
Subject: [PATCH] fixed coding style issues
Fexed coding style issues from scripts/checkpatch.pl in drivers/input
Signed-off-by: Baodong Chen <chenbdchenbd@...il.com>
---
drivers/input/apm-power.c | 2 +-
drivers/input/evdev.c | 52 +++++++++++++++++++++++++++++++---------
drivers/input/ff-core.c | 4 +-
drivers/input/ff-memless.c | 12 ++++----
drivers/input/joydev.c | 2 +-
drivers/input/mousedev.c | 32 ++++++++++++++++--------
drivers/input/sparse-keymap.c | 4 +-
7 files changed, 73 insertions(+), 35 deletions(-)
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
index e90ee3d..543d85b 100644
--- a/drivers/input/apm-power.c
+++ b/drivers/input/apm-power.c
@@ -33,7 +33,7 @@ static void system_power_event(unsigned int keycode)
}
static void apmpower_event(struct input_handle *handle, unsigned int type,
- unsigned int code, int value)
+ unsigned int code, int value)
{
/* only react on key down events */
if (value != 1)
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 6c58bff..a0104bd 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -547,16 +547,44 @@ static int handle_eviocgbit(struct input_dev *dev,
switch (type) {
- case 0: bits = dev->evbit; len = EV_MAX; break;
- case EV_KEY: bits = dev->keybit; len = KEY_MAX; break;
- case EV_REL: bits = dev->relbit; len = REL_MAX; break;
- case EV_ABS: bits = dev->absbit; len = ABS_MAX; break;
- case EV_MSC: bits = dev->mscbit; len = MSC_MAX; break;
- case EV_LED: bits = dev->ledbit; len = LED_MAX; break;
- case EV_SND: bits = dev->sndbit; len = SND_MAX; break;
- case EV_FF: bits = dev->ffbit; len = FF_MAX; break;
- case EV_SW: bits = dev->swbit; len = SW_MAX; break;
- default: return -EINVAL;
+ case 0:
+ bits = dev->evbit;
+ len = EV_MAX;
+ break;
+ case EV_KEY:
+ bits = dev->keybit;
+ len = KEY_MAX;
+ break;
+ case EV_REL:
+ bits = dev->relbit;
+ len = REL_MAX;
+ break;
+ case EV_ABS:
+ bits = dev->absbit;
+ len = ABS_MAX;
+ break;
+ case EV_MSC:
+ bits = dev->mscbit;
+ len = MSC_MAX;
+ break;
+ case EV_LED:
+ bits = dev->ledbit;
+ len = LED_MAX;
+ break;
+ case EV_SND:
+ bits = dev->sndbit;
+ len = SND_MAX;
+ break;
+ case EV_FF:
+ bits = dev->ffbit;
+ len = FF_MAX;
+ break;
+ case EV_SW:
+ bits = dev->swbit;
+ len = SW_MAX;
+ break;
+ default:
+ return -EINVAL;
}
/*
@@ -567,8 +595,8 @@ static int handle_eviocgbit(struct input_dev *dev,
if (type == EV_KEY && size == OLD_KEY_MAX) {
len = OLD_KEY_MAX;
if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
- pr_warning("(EVIOCGBIT): Suspicious buffer size %u, "
- "limiting output to %zu bytes. See "
+ pr_warn("(EVIOCGBIT): Suspicious buffer size %u, " \
+ "limiting output to %zu bytes. See " \
"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
OLD_KEY_MAX,
BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 480eb9d..f50f6dd 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -138,8 +138,8 @@ int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
if (effect->id == -1) {
for (id = 0; id < ff->max_effects; id++)
- if (!ff->effect_owners[id])
- break;
+ if (!ff->effect_owners[id])
+ break;
if (id >= ff->max_effects) {
ret = -ENOSPC;
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index 5f55885..a237cf2 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -72,12 +72,12 @@ static const struct ff_envelope *get_envelope(const struct ff_effect *effect)
static const struct ff_envelope empty_envelope;
switch (effect->type) {
- case FF_PERIODIC:
- return &effect->u.periodic.envelope;
- case FF_CONSTANT:
- return &effect->u.constant.envelope;
- default:
- return &empty_envelope;
+ case FF_PERIODIC:
+ return &effect->u.periodic.envelope;
+ case FF_CONSTANT:
+ return &effect->u.constant.envelope;
+ default:
+ return &empty_envelope;
}
}
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 26043cc..78f323e 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -711,7 +711,7 @@ static long joydev_ioctl(struct file *file,
case JS_SET_ALL:
retval = copy_from_user(&joydev->glue, argp,
- sizeof(joydev->glue)) ? -EFAULT: 0;
+ sizeof(joydev->glue)) ? -EFAULT : 0;
break;
case JS_GET_ALL:
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 0110b5a..80bbe52 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -236,25 +236,36 @@ static void mousedev_key_event(struct mousedev *mousedev,
case BTN_TOUCH:
case BTN_0:
- case BTN_LEFT: index = 0; break;
+ case BTN_LEFT:
+ index = 0;
+ break;
case BTN_STYLUS:
case BTN_1:
- case BTN_RIGHT: index = 1; break;
+ case BTN_RIGHT:
+ index = 1;
+ break;
case BTN_2:
case BTN_FORWARD:
case BTN_STYLUS2:
- case BTN_MIDDLE: index = 2; break;
+ case BTN_MIDDLE:
+ index = 2;
+ break;
case BTN_3:
case BTN_BACK:
- case BTN_SIDE: index = 3; break;
+ case BTN_SIDE:
+ index = 3;
+ break;
case BTN_4:
- case BTN_EXTRA: index = 4; break;
+ case BTN_EXTRA:
+ index = 4;
+ break;
- default: return;
+ default:
+ return;
}
if (value) {
@@ -551,17 +562,16 @@ static int mousedev_open(struct inode *inode, struct file *file)
return -ENODEV;
error = mutex_lock_interruptible(&mousedev_table_mutex);
- if (error) {
+ if (error)
return error;
- }
+
mousedev = mousedev_table[i];
if (mousedev)
get_device(&mousedev->dev);
mutex_unlock(&mousedev_table_mutex);
- if (!mousedev) {
+ if (!mousedev)
return -ENODEV;
- }
client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL);
if (!client) {
@@ -1088,7 +1098,7 @@ static int __init mousedev_init(void)
#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
error = misc_register(&psaux_mouse);
if (error)
- pr_warning("could not register psaux device, error: %d\n",
+ pr_warn("could not register psaux device, error: %d\n",
error);
else
psaux_registered = 1;
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 75fb040..a70aa55 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -180,11 +180,11 @@ int sparse_keymap_setup(struct input_dev *dev,
for (e = keymap; e->type != KE_END; e++)
map_size++;
- map = kcalloc(map_size, sizeof (struct key_entry), GFP_KERNEL);
+ map = kcalloc(map_size, sizeof(struct key_entry), GFP_KERNEL);
if (!map)
return -ENOMEM;
- memcpy(map, keymap, map_size * sizeof (struct key_entry));
+ memcpy(map, keymap, map_size * sizeof(struct key_entry));
for (i = 0; i < map_size; i++) {
entry = &map[i];
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists