aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/apm-power.c2
-rw-r--r--drivers/input/ff-core.c4
-rw-r--r--drivers/input/ff-memless.c14
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/mousedev.c9
-rw-r--r--drivers/input/sparse-keymap.c4
6 files changed, 18 insertions, 17 deletions
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
index e90ee3d30613..650177a3c858 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)
33} 33}
34 34
35static void apmpower_event(struct input_handle *handle, unsigned int type, 35static void apmpower_event(struct input_handle *handle, unsigned int type,
36 unsigned int code, int value) 36 unsigned int code, int value)
37{ 37{
38 /* only react on key down events */ 38 /* only react on key down events */
39 if (value != 1) 39 if (value != 1)
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 480eb9d9876a..f50f6dd92274 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,
138 138
139 if (effect->id == -1) { 139 if (effect->id == -1) {
140 for (id = 0; id < ff->max_effects; id++) 140 for (id = 0; id < ff->max_effects; id++)
141 if (!ff->effect_owners[id]) 141 if (!ff->effect_owners[id])
142 break; 142 break;
143 143
144 if (id >= ff->max_effects) { 144 if (id >= ff->max_effects) {
145 ret = -ENOSPC; 145 ret = -ENOSPC;
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index b107922514fb..74c0d8c6002a 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -72,12 +72,14 @@ static const struct ff_envelope *get_envelope(const struct ff_effect *effect)
72 static const struct ff_envelope empty_envelope; 72 static const struct ff_envelope empty_envelope;
73 73
74 switch (effect->type) { 74 switch (effect->type) {
75 case FF_PERIODIC: 75 case FF_PERIODIC:
76 return &effect->u.periodic.envelope; 76 return &effect->u.periodic.envelope;
77 case FF_CONSTANT: 77
78 return &effect->u.constant.envelope; 78 case FF_CONSTANT:
79 default: 79 return &effect->u.constant.envelope;
80 return &empty_envelope; 80
81 default:
82 return &empty_envelope;
81 } 83 }
82} 84}
83 85
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 26043cc6a016..78f323ea1e4b 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -711,7 +711,7 @@ static long joydev_ioctl(struct file *file,
711 711
712 case JS_SET_ALL: 712 case JS_SET_ALL:
713 retval = copy_from_user(&joydev->glue, argp, 713 retval = copy_from_user(&joydev->glue, argp,
714 sizeof(joydev->glue)) ? -EFAULT: 0; 714 sizeof(joydev->glue)) ? -EFAULT : 0;
715 break; 715 break;
716 716
717 case JS_GET_ALL: 717 case JS_GET_ALL:
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 0110b5a3a167..964e43d81e29 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -551,17 +551,16 @@ static int mousedev_open(struct inode *inode, struct file *file)
551 return -ENODEV; 551 return -ENODEV;
552 552
553 error = mutex_lock_interruptible(&mousedev_table_mutex); 553 error = mutex_lock_interruptible(&mousedev_table_mutex);
554 if (error) { 554 if (error)
555 return error; 555 return error;
556 } 556
557 mousedev = mousedev_table[i]; 557 mousedev = mousedev_table[i];
558 if (mousedev) 558 if (mousedev)
559 get_device(&mousedev->dev); 559 get_device(&mousedev->dev);
560 mutex_unlock(&mousedev_table_mutex); 560 mutex_unlock(&mousedev_table_mutex);
561 561
562 if (!mousedev) { 562 if (!mousedev)
563 return -ENODEV; 563 return -ENODEV;
564 }
565 564
566 client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL); 565 client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL);
567 if (!client) { 566 if (!client) {
@@ -1088,7 +1087,7 @@ static int __init mousedev_init(void)
1088#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX 1087#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
1089 error = misc_register(&psaux_mouse); 1088 error = misc_register(&psaux_mouse);
1090 if (error) 1089 if (error)
1091 pr_warning("could not register psaux device, error: %d\n", 1090 pr_warn("could not register psaux device, error: %d\n",
1092 error); 1091 error);
1093 else 1092 else
1094 psaux_registered = 1; 1093 psaux_registered = 1;
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 75fb040a3435..a70aa555bbff 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,
180 for (e = keymap; e->type != KE_END; e++) 180 for (e = keymap; e->type != KE_END; e++)
181 map_size++; 181 map_size++;
182 182
183 map = kcalloc(map_size, sizeof (struct key_entry), GFP_KERNEL); 183 map = kcalloc(map_size, sizeof(struct key_entry), GFP_KERNEL);
184 if (!map) 184 if (!map)
185 return -ENOMEM; 185 return -ENOMEM;
186 186
187 memcpy(map, keymap, map_size * sizeof (struct key_entry)); 187 memcpy(map, keymap, map_size * sizeof(struct key_entry));
188 188
189 for (i = 0; i < map_size; i++) { 189 for (i = 0; i < map_size; i++) {
190 entry = &map[i]; 190 entry = &map[i];