diff options
author | Antonio Ospite <ao2@ao2.it> | 2015-02-16 12:12:24 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-02-18 15:36:13 -0500 |
commit | 2e701a359ac2833381e5d226802bed8fd1946238 (patch) | |
tree | f2e869028c8214ae09821092a847a33f381d763e /drivers/hid | |
parent | dad89ad046b0a9cfad99fb30e27df2be5bf76b54 (diff) |
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')
-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, | |||
1131 | */ | 1131 | */ |
1132 | static int sixaxis_set_operational_usb(struct hid_device *hdev) | 1132 | static int sixaxis_set_operational_usb(struct hid_device *hdev) |
1133 | { | 1133 | { |
1134 | int ret; | ||
1135 | const int buf_size = | 1134 | const int buf_size = |
1136 | max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE); | 1135 | max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE); |
1137 | __u8 *buf = kmalloc(buf_size, GFP_KERNEL); | 1136 | __u8 *buf; |
1137 | int ret; | ||
1138 | 1138 | ||
1139 | buf = kmalloc(buf_size, GFP_KERNEL); | ||
1139 | if (!buf) | 1140 | if (!buf) |
1140 | return -ENOMEM; | 1141 | return -ENOMEM; |
1141 | 1142 | ||
1142 | ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE, | 1143 | ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE, |
1143 | HID_FEATURE_REPORT, HID_REQ_GET_REPORT); | 1144 | HID_FEATURE_REPORT, HID_REQ_GET_REPORT); |
1144 | |||
1145 | if (ret < 0) { | 1145 | if (ret < 0) { |
1146 | hid_err(hdev, "can't set operational mode: step 1\n"); | 1146 | hid_err(hdev, "can't set operational mode: step 1\n"); |
1147 | goto out; | 1147 | goto out; |
@@ -1153,14 +1153,12 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) | |||
1153 | */ | 1153 | */ |
1154 | ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE, | 1154 | ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE, |
1155 | HID_FEATURE_REPORT, HID_REQ_GET_REPORT); | 1155 | HID_FEATURE_REPORT, HID_REQ_GET_REPORT); |
1156 | |||
1157 | if (ret < 0) { | 1156 | if (ret < 0) { |
1158 | hid_err(hdev, "can't set operational mode: step 2\n"); | 1157 | hid_err(hdev, "can't set operational mode: step 2\n"); |
1159 | goto out; | 1158 | goto out; |
1160 | } | 1159 | } |
1161 | 1160 | ||
1162 | ret = hid_hw_output_report(hdev, buf, 1); | 1161 | ret = hid_hw_output_report(hdev, buf, 1); |
1163 | |||
1164 | if (ret < 0) | 1162 | if (ret < 0) |
1165 | hid_err(hdev, "can't set operational mode: step 3\n"); | 1163 | hid_err(hdev, "can't set operational mode: step 3\n"); |
1166 | 1164 | ||