diff options
author | Antonio Ospite <ao2@ao2.it> | 2015-02-16 20:12:24 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-02-18 23:36:13 +0300 |
commit | 2e701a359ac2833381e5d226802bed8fd1946238 (patch) | |
tree | f2e869028c8214ae09821092a847a33f381d763e /drivers/hid/hid-sony.c | |
parent | dad89ad046b0a9cfad99fb30e27df2be5bf76b54 (diff) | |
download | linux-2e701a359ac2833381e5d226802bed8fd1946238.tar.xz |
HID: sony: Coding style cleanups in sixaxis_set_operational_usb()
Don't mix declaration and allocation, remove some useless newlines
between calling a function and checking its return value.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r-- | drivers/hid/hid-sony.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index ec542be818d5..fa11930dfee2 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1131,17 +1131,17 @@ static void sony_input_configured(struct hid_device *hdev, */ static int sixaxis_set_operational_usb(struct hid_device *hdev) { - int ret; const int buf_size = max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE); - __u8 *buf = kmalloc(buf_size, GFP_KERNEL); + __u8 *buf; + int ret; + buf = kmalloc(buf_size, GFP_KERNEL); if (!buf) return -ENOMEM; ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE, HID_FEATURE_REPORT, HID_REQ_GET_REPORT); - if (ret < 0) { hid_err(hdev, "can't set operational mode: step 1\n"); goto out; @@ -1153,14 +1153,12 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) */ ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE, HID_FEATURE_REPORT, HID_REQ_GET_REPORT); - if (ret < 0) { hid_err(hdev, "can't set operational mode: step 2\n"); goto out; } ret = hid_hw_output_report(hdev, buf, 1); - if (ret < 0) hid_err(hdev, "can't set operational mode: step 3\n"); |