mirror of https://gitee.com/openkylin/linux.git
Input: iforce - update formatting of switch statements
According to our coding style case labels in switch statements should be aligned with the switch keyword. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
4873586278
commit
43e61fc77f
|
@ -132,7 +132,6 @@ static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect,
|
|||
* Upload the effect
|
||||
*/
|
||||
switch (effect->type) {
|
||||
|
||||
case FF_PERIODIC:
|
||||
ret = iforce_upload_periodic(iforce, effect, old);
|
||||
break;
|
||||
|
@ -351,11 +350,9 @@ int iforce_init_device(struct device *parent, u16 bustype,
|
|||
signed short t = iforce->type->abs[i];
|
||||
|
||||
switch (t) {
|
||||
|
||||
case ABS_X:
|
||||
case ABS_Y:
|
||||
case ABS_WHEEL:
|
||||
|
||||
input_set_abs_params(input_dev, t, -1920, 1920, 16, 128);
|
||||
set_bit(t, input_dev->ffbit);
|
||||
break;
|
||||
|
@ -363,12 +360,10 @@ int iforce_init_device(struct device *parent, u16 bustype,
|
|||
case ABS_THROTTLE:
|
||||
case ABS_GAS:
|
||||
case ABS_BRAKE:
|
||||
|
||||
input_set_abs_params(input_dev, t, 0, 255, 0, 0);
|
||||
break;
|
||||
|
||||
case ABS_RUDDER:
|
||||
|
||||
input_set_abs_params(input_dev, t, -128, 127, 0, 0);
|
||||
break;
|
||||
|
||||
|
@ -376,7 +371,6 @@ int iforce_init_device(struct device *parent, u16 bustype,
|
|||
case ABS_HAT0Y:
|
||||
case ABS_HAT1X:
|
||||
case ABS_HAT1Y:
|
||||
|
||||
input_set_abs_params(input_dev, t, -1, 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -166,14 +166,20 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
|
|||
if (i <= 8) {
|
||||
int btns = data[6];
|
||||
if (test_bit(ABS_HAT1X, dev->absbit)) {
|
||||
if (btns & 8) input_report_abs(dev, ABS_HAT1X, -1);
|
||||
else if (btns & 2) input_report_abs(dev, ABS_HAT1X, 1);
|
||||
else input_report_abs(dev, ABS_HAT1X, 0);
|
||||
if (btns & 8)
|
||||
input_report_abs(dev, ABS_HAT1X, -1);
|
||||
else if (btns & 2)
|
||||
input_report_abs(dev, ABS_HAT1X, 1);
|
||||
else
|
||||
input_report_abs(dev, ABS_HAT1X, 0);
|
||||
}
|
||||
if (test_bit(ABS_HAT1Y, dev->absbit)) {
|
||||
if (btns & 1) input_report_abs(dev, ABS_HAT1Y, -1);
|
||||
else if (btns & 4) input_report_abs(dev, ABS_HAT1Y, 1);
|
||||
else input_report_abs(dev, ABS_HAT1Y, 0);
|
||||
if (btns & 1)
|
||||
input_report_abs(dev, ABS_HAT1Y, -1);
|
||||
else if (btns & 4)
|
||||
input_report_abs(dev, ABS_HAT1Y, 1);
|
||||
else
|
||||
input_report_abs(dev, ABS_HAT1Y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue