aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Malý <madcatxster@gmail.com>2012-09-23 19:13:17 -0400
committerJiri Kosina <jkosina@suse.cz>2012-09-25 09:43:01 -0400
commita80fe5d6e3190f65be8cc7efa487f187eb3dbffa (patch)
treef281a25376f43d684f8a882c881d13f2a59359eb
parenta2063172ccafb5e7748a3b6719df8ac68ec89060 (diff)
HID: lg4ff: Minor coding style fixes in lg4ff and hid-lg
Fixes a couple of minor coding style issues. Signed-off-by: Michal Malý <madcatxster@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-lg.c6
-rw-r--r--drivers/hid/hid-lg4ff.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 760b30bc2734..afc4de389f81 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -361,7 +361,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
361 return -ENOMEM; 361 return -ENOMEM;
362 } 362 }
363 drv_data->quirks = id->driver_data; 363 drv_data->quirks = id->driver_data;
364 364
365 hid_set_drvdata(hdev, (void *)drv_data); 365 hid_set_drvdata(hdev, (void *)drv_data);
366 366
367 if (drv_data->quirks & LG_NOGET) 367 if (drv_data->quirks & LG_NOGET)
@@ -383,7 +383,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
383 } 383 }
384 384
385 /* Setup wireless link with Logitech Wii wheel */ 385 /* Setup wireless link with Logitech Wii wheel */
386 if(hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { 386 if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) {
387 unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; 387 unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
388 388
389 ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT); 389 ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
@@ -479,7 +479,7 @@ static const struct hid_device_id lg_devices[] = {
479 .driver_data = LG_NOGET | LG_FF4 }, 479 .driver_data = LG_NOGET | LG_FF4 },
480 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL), 480 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL),
481 .driver_data = LG_FF4 }, 481 .driver_data = LG_FF4 },
482 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ), 482 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG),
483 .driver_data = LG_FF }, 483 .driver_data = LG_FF },
484 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2), 484 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
485 .driver_data = LG_FF2 }, 485 .driver_data = LG_FF2 },
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 4ea7ccaa15ea..4fb4a80928c8 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -193,7 +193,7 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
193 __s32 *value = report->field[0]->value; 193 __s32 *value = report->field[0]->value;
194 int x; 194 int x;
195 195
196#define CLAMP(x) if (x < 0) x = 0; if (x > 0xff) x = 0xff 196#define CLAMP(x) do { if (x < 0) x = 0; else if (x > 0xff) x = 0xff; } while (0)
197 197
198 switch (effect->type) { 198 switch (effect->type) {
199 case FF_CONSTANT: 199 case FF_CONSTANT:
@@ -285,7 +285,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
285 285
286 /* Prepare "coarse" limit command */ 286 /* Prepare "coarse" limit command */
287 value[0] = 0xf8; 287 value[0] = 0xf8;
288 value[1] = 0x00; /* Set later */ 288 value[1] = 0x00; /* Set later */
289 value[2] = 0x00; 289 value[2] = 0x00;
290 value[3] = 0x00; 290 value[3] = 0x00;
291 value[4] = 0x00; 291 value[4] = 0x00;