From patchwork Wed Jul 25 07:11:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baodong Chen X-Patchwork-Id: 1235851 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2DC15E006E for ; Wed, 25 Jul 2012 07:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753956Ab2GYHLq (ORCPT ); Wed, 25 Jul 2012 03:11:46 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:38132 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195Ab2GYHLp (ORCPT ); Wed, 25 Jul 2012 03:11:45 -0400 Received: by pbbrp8 with SMTP id rp8so958850pbb.19 for ; Wed, 25 Jul 2012 00:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=4urz5S99EctgdcCzeYZQozI4xnFDtUcG3Kljx67YgXI=; b=vFATjAbmAxqemdsleuJOzupKzzF4g4i7f6mWOvchmeEr1Ye1fUPKc1eAM13AdE17xx g5PfH44Fe3y5sM6Y/rXA+AICpbqJDKAbdxNa6I/oywS/skCR2ENaned9OZG9G0FNFKLX 6kprwaWUMiP07K4ND+ugaZQScgZlBFQDd+M2BqlUPUmXTjiP30G5m2KulF4OM3+ANFWe 45uz2uX/rCZnouMe526gphCqkGdpyAHReFli4nwA8qs3lw1zOcFoLUkH1MSLERDweAQe yzqkMgqSlTXWBVvZbI90uSPpLQnAMDIVCQpeKIw7RlIBM7DTDF25bhWso6c6SRi1Hdus RMyA== Received: by 10.68.202.136 with SMTP id ki8mr50866383pbc.65.1343200304650; Wed, 25 Jul 2012 00:11:44 -0700 (PDT) Received: from localhost ([183.45.58.29]) by mx.google.com with ESMTPS id of1sm13810286pbb.15.2012.07.25.00.11.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 00:11:43 -0700 (PDT) From: Baodong Chen To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Baodong Chen Subject: [PATCH] fixed coding style issues Date: Wed, 25 Jul 2012 15:11:17 +0800 Message-Id: <1343200277-14385-1-git-send-email-chenbdchenbd@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Fexed coding style issues from scripts/checkpatch.pl in drivers/input Signed-off-by: Baodong Chen --- 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];