Skip to content

Commit 68aa210

Browse files
wantyappsVudentz
authored andcommitted
Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl
This fixes some CHECKs reported by the checkpatch script. Issues reported in ath3k.c: ------- ath3k.c ------- CHECK: Please don't use multiple blank lines + + CHECK: Blank lines aren't necessary after an open brace '{' +static const struct usb_device_id ath3k_blist_tbl[] = { + CHECK: Alignment should match open parenthesis +static int ath3k_load_firmware(struct usb_device *udev, + const struct firmware *firmware) CHECK: Alignment should match open parenthesis + err = usb_bulk_msg(udev, pipe, send_buf, size, + &len, 3000); CHECK: Unnecessary parentheses around 'len != size' + if (err || (len != size)) { CHECK: Alignment should match open parenthesis +static int ath3k_get_version(struct usb_device *udev, + struct ath3k_version *version) CHECK: Alignment should match open parenthesis +static int ath3k_load_fwfile(struct usb_device *udev, + const struct firmware *firmware) CHECK: Alignment should match open parenthesis + err = usb_bulk_msg(udev, pipe, send_buf, size, + &len, 3000); CHECK: Unnecessary parentheses around 'len != size' + if (err || (len != size)) { CHECK: Blank lines aren't necessary after an open brace '{' + switch (fw_version.ref_clock) { + CHECK: Alignment should match open parenthesis + snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s", + le32_to_cpu(fw_version.rom_version), clk_value, ".dfu"); CHECK: Alignment should match open parenthesis +static int ath3k_probe(struct usb_interface *intf, + const struct usb_device_id *id) CHECK: Alignment should match open parenthesis + BT_ERR("Firmware file \"%s\" not found", + ATH3K_FIRMWARE); CHECK: Alignment should match open parenthesis + BT_ERR("Firmware file \"%s\" request failed (err=%d)", + ATH3K_FIRMWARE, ret); total: 0 errors, 0 warnings, 14 checks, 540 lines checked Signed-off-by: Uri Arev <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 51931c5 commit 68aa210

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

drivers/bluetooth/ath3k.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright (c) 2008-2009 Atheros Communications Inc.
44
*/
55

6-
76
#include <linux/module.h>
87
#include <linux/kernel.h>
98
#include <linux/init.h>
@@ -128,7 +127,6 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
128127
* for AR3012
129128
*/
130129
static const struct usb_device_id ath3k_blist_tbl[] = {
131-
132130
/* Atheros AR3012 with sflash firmware*/
133131
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
134132
{ USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
@@ -202,7 +200,7 @@ static inline void ath3k_log_failed_loading(int err, int len, int size,
202200
#define TIMEGAP_USEC_MAX 100
203201

204202
static int ath3k_load_firmware(struct usb_device *udev,
205-
const struct firmware *firmware)
203+
const struct firmware *firmware)
206204
{
207205
u8 *send_buf;
208206
int len = 0;
@@ -237,9 +235,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
237235
memcpy(send_buf, firmware->data + sent, size);
238236

239237
err = usb_bulk_msg(udev, pipe, send_buf, size,
240-
&len, 3000);
238+
&len, 3000);
241239

242-
if (err || (len != size)) {
240+
if (err || len != size) {
243241
ath3k_log_failed_loading(err, len, size, count);
244242
goto error;
245243
}
@@ -262,7 +260,7 @@ static int ath3k_get_state(struct usb_device *udev, unsigned char *state)
262260
}
263261

264262
static int ath3k_get_version(struct usb_device *udev,
265-
struct ath3k_version *version)
263+
struct ath3k_version *version)
266264
{
267265
return usb_control_msg_recv(udev, 0, ATH3K_GETVERSION,
268266
USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
@@ -271,7 +269,7 @@ static int ath3k_get_version(struct usb_device *udev,
271269
}
272270

273271
static int ath3k_load_fwfile(struct usb_device *udev,
274-
const struct firmware *firmware)
272+
const struct firmware *firmware)
275273
{
276274
u8 *send_buf;
277275
int len = 0;
@@ -310,8 +308,8 @@ static int ath3k_load_fwfile(struct usb_device *udev,
310308
memcpy(send_buf, firmware->data + sent, size);
311309

312310
err = usb_bulk_msg(udev, pipe, send_buf, size,
313-
&len, 3000);
314-
if (err || (len != size)) {
311+
&len, 3000);
312+
if (err || len != size) {
315313
ath3k_log_failed_loading(err, len, size, count);
316314
kfree(send_buf);
317315
return err;
@@ -425,7 +423,6 @@ static int ath3k_load_syscfg(struct usb_device *udev)
425423
}
426424

427425
switch (fw_version.ref_clock) {
428-
429426
case ATH3K_XTAL_FREQ_26M:
430427
clk_value = 26;
431428
break;
@@ -441,7 +438,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
441438
}
442439

443440
snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
444-
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
441+
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
445442

446443
ret = request_firmware(&firmware, filename, &udev->dev);
447444
if (ret < 0) {
@@ -456,7 +453,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
456453
}
457454

458455
static int ath3k_probe(struct usb_interface *intf,
459-
const struct usb_device_id *id)
456+
const struct usb_device_id *id)
460457
{
461458
const struct firmware *firmware;
462459
struct usb_device *udev = interface_to_usbdev(intf);
@@ -505,10 +502,10 @@ static int ath3k_probe(struct usb_interface *intf,
505502
if (ret < 0) {
506503
if (ret == -ENOENT)
507504
BT_ERR("Firmware file \"%s\" not found",
508-
ATH3K_FIRMWARE);
505+
ATH3K_FIRMWARE);
509506
else
510507
BT_ERR("Firmware file \"%s\" request failed (err=%d)",
511-
ATH3K_FIRMWARE, ret);
508+
ATH3K_FIRMWARE, ret);
512509
return ret;
513510
}
514511

0 commit comments

Comments
 (0)