HID: lg4ff: Minor coding style fixes in lg4ff and hid-lg
authorMichal Malý <madcatxster@gmail.com>
Sun, 23 Sep 2012 23:13:17 +0000 (01:13 +0200)
committerJiri Kosina <jkosina@suse.cz>
Tue, 25 Sep 2012 13:43:01 +0000 (15:43 +0200)
Fixes a couple of minor coding style issues.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-lg.c
drivers/hid/hid-lg4ff.c

index 760b30bc2734feb2e7c2bbf4cea42e31a4002eea..afc4de389f81a715828170e7e0380745d1f6d53a 100644 (file)
@@ -361,7 +361,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
                return -ENOMEM;
        }
        drv_data->quirks = id->driver_data;
-       
+
        hid_set_drvdata(hdev, (void *)drv_data);
 
        if (drv_data->quirks & LG_NOGET)
@@ -383,7 +383,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
        }
 
        /* Setup wireless link with Logitech Wii wheel */
-       if(hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) {
+       if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) {
                unsigned char buf[] = { 0x00, 0xAF,  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
                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[] = {
                .driver_data = LG_NOGET | LG_FF4 },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL),
                .driver_data = LG_FF4 },
-       { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ),
+       { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG),
                .driver_data = LG_FF },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
                .driver_data = LG_FF2 },
index 4ea7ccaa15ea6fa470ebe76a178087ea18aab66a..4fb4a80928c8fe2ea6d18a7cd8a67af5276868ac 100644 (file)
@@ -193,7 +193,7 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
        __s32 *value = report->field[0]->value;
        int x;
 
-#define CLAMP(x) if (x < 0) x = 0; if (x > 0xff) x = 0xff
+#define CLAMP(x) do { if (x < 0) x = 0; else if (x > 0xff) x = 0xff; } while (0)
 
        switch (effect->type) {
        case FF_CONSTANT:
@@ -285,7 +285,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
 
        /* Prepare "coarse" limit command */
        value[0] = 0xf8;
-       value[1] = 0x00;        /* Set later */
+       value[1] = 0x00;        /* Set later */
        value[2] = 0x00;
        value[3] = 0x00;
        value[4] = 0x00;