All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl
@ 2024-04-04 19:13 me
  2024-04-04 19:57 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: me @ 2024-04-04 19:13 UTC (permalink / raw)
  Cc: me, Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel

From: Uri Arev <me@wantyapps.xyz>

This fixes some CHECKs reported by the checpatch 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 <me@wantyapps.xyz>
---
 drivers/bluetooth/ath3k.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 88262d3a9392..ce97b336fbfb 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -3,7 +3,6 @@
  * Copyright (c) 2008-2009 Atheros Communications Inc.
  */
 
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -128,7 +127,6 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
  * for AR3012
  */
 static const struct usb_device_id ath3k_blist_tbl[] = {
-
 	/* Atheros AR3012 with sflash firmware*/
 	{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
 	{ 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,
 #define TIMEGAP_USEC_MAX	100
 
 static int ath3k_load_firmware(struct usb_device *udev,
-				const struct firmware *firmware)
+			       const struct firmware *firmware)
 {
 	u8 *send_buf;
 	int len = 0;
@@ -237,9 +235,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
-					&len, 3000);
+				   &len, 3000);
 
-		if (err || (len != size)) {
+		if (err || len != size) {
 			ath3k_log_failed_loading(err, len, size, count);
 			goto error;
 		}
@@ -262,7 +260,7 @@ static int ath3k_get_state(struct usb_device *udev, unsigned char *state)
 }
 
 static int ath3k_get_version(struct usb_device *udev,
-			struct ath3k_version *version)
+			     struct ath3k_version *version)
 {
 	return usb_control_msg_recv(udev, 0, ATH3K_GETVERSION,
 				    USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
@@ -271,7 +269,7 @@ static int ath3k_get_version(struct usb_device *udev,
 }
 
 static int ath3k_load_fwfile(struct usb_device *udev,
-		const struct firmware *firmware)
+			     const struct firmware *firmware)
 {
 	u8 *send_buf;
 	int len = 0;
@@ -310,8 +308,8 @@ static int ath3k_load_fwfile(struct usb_device *udev,
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
-					&len, 3000);
-		if (err || (len != size)) {
+				   &len, 3000);
+		if (err || len != size) {
 			ath3k_log_failed_loading(err, len, size, count);
 			kfree(send_buf);
 			return err;
@@ -425,7 +423,6 @@ static int ath3k_load_syscfg(struct usb_device *udev)
 	}
 
 	switch (fw_version.ref_clock) {
-
 	case ATH3K_XTAL_FREQ_26M:
 		clk_value = 26;
 		break;
@@ -441,7 +438,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
 	}
 
 	snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
-		le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
+		 le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
 
 	ret = request_firmware(&firmware, filename, &udev->dev);
 	if (ret < 0) {
@@ -456,7 +453,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
 }
 
 static int ath3k_probe(struct usb_interface *intf,
-			const struct usb_device_id *id)
+		       const struct usb_device_id *id)
 {
 	const struct firmware *firmware;
 	struct usb_device *udev = interface_to_usbdev(intf);
@@ -505,10 +502,10 @@ static int ath3k_probe(struct usb_interface *intf,
 	if (ret < 0) {
 		if (ret == -ENOENT)
 			BT_ERR("Firmware file \"%s\" not found",
-							ATH3K_FIRMWARE);
+			       ATH3K_FIRMWARE);
 		else
 			BT_ERR("Firmware file \"%s\" request failed (err=%d)",
-							ATH3K_FIRMWARE, ret);
+			       ATH3K_FIRMWARE, ret);
 		return ret;
 	}
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl
  2024-04-04 19:13 [PATCH] Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl me
@ 2024-04-04 19:57 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2024-04-04 19:57 UTC (permalink / raw)
  To: linux-bluetooth, me

[-- Attachment #1: Type: text/plain, Size: 4844 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=841553

---Test result---

Test Summary:
CheckPatch                    PASS      0.68 seconds
GitLint                       FAIL      0.51 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      29.86 seconds
CheckAllWarning               PASS      32.46 seconds
CheckSparse                   PASS      43.20 seconds
CheckSmatch                   FAIL      34.86 seconds
BuildKernel32                 PASS      28.92 seconds
TestRunnerSetup               PASS      519.31 seconds
TestRunner_l2cap-tester       PASS      18.38 seconds
TestRunner_iso-tester         FAIL      32.33 seconds
TestRunner_bnep-tester        PASS      4.65 seconds
TestRunner_mgmt-tester        FAIL      114.31 seconds
TestRunner_rfcomm-tester      PASS      7.24 seconds
TestRunner_sco-tester         PASS      14.95 seconds
TestRunner_ioctl-tester       PASS      10.37 seconds
TestRunner_mesh-tester        PASS      7.01 seconds
TestRunner_smp-tester         PASS      6.76 seconds
TestRunner_userchan-tester    PASS      4.86 seconds
IncrementalBuild              PASS      27.95 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
21: B3 Line contains hard tab characters (\t): "+				const struct firmware *firmware)"
24: B3 Line contains hard tab characters (\t): "+		err = usb_bulk_msg(udev, pipe, send_buf, size,"
25: B3 Line contains hard tab characters (\t): "+					&len, 3000);"
28: B3 Line contains hard tab characters (\t): "+		if (err || (len != size)) {"
32: B3 Line contains hard tab characters (\t): "+			struct ath3k_version *version)"
36: B3 Line contains hard tab characters (\t): "+		const struct firmware *firmware)"
39: B3 Line contains hard tab characters (\t): "+		err = usb_bulk_msg(udev, pipe, send_buf, size,"
40: B3 Line contains hard tab characters (\t): "+					&len, 3000);"
43: B3 Line contains hard tab characters (\t): "+		if (err || (len != size)) {"
46: B3 Line contains hard tab characters (\t): "+	switch (fw_version.ref_clock) {"
50: B3 Line contains hard tab characters (\t): "+	snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s","
51: B3 Line contains hard tab characters (\t): "+		le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");"
55: B3 Line contains hard tab characters (\t): "+			const struct usb_device_id *id)"
58: B3 Line contains hard tab characters (\t): "+			BT_ERR("Firmware file \"%s\" not found","
59: B3 Line contains hard tab characters (\t): "+							ATH3K_FIRMWARE);"
62: B3 Line contains hard tab characters (\t): "+			BT_ERR("Firmware file \"%s\" request failed (err=%d)","
63: B3 Line contains hard tab characters (\t): "+							ATH3K_FIRMWARE, ret);"
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139
make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 121, Passed: 120 (99.2%), Failed: 1, Not Run: 0

Failed Test Cases
ISO Connect2 Suspend - Success                       Failed       4.209 seconds
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 492, Passed: 489 (99.4%), Failed: 1, Not Run: 2

Failed Test Cases
LL Privacy - Remove Device 4 (Disable Adv)           Timed out    2.606 seconds


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-04 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 19:13 [PATCH] Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl me
2024-04-04 19:57 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.