diff mbox series

[BlueZ] tools: Switch hciattach_qualcomm to FAILIF macro completely

Message ID 20221101202636.143165-1-marex@denx.de (mailing list archive)
State Accepted
Commit f9657b86ddd3008768b3f6fef2c94eec46d976b5
Headers show
Series [BlueZ] tools: Switch hciattach_qualcomm to FAILIF macro completely | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/setupell success Setup ELL PASS
tedd_an/buildprep success Build Prep PASS
tedd_an/build success Build Configuration PASS
tedd_an/makecheck success Make Check PASS
tedd_an/makecheckvalgrind success Make Check PASS
tedd_an/makedistcheck success Make Distcheck PASS
tedd_an/build_extell success Build External ELL PASS
tedd_an/build_extell_make success Build Make with External ELL PASS
tedd_an/scan_build success Pass

Commit Message

Marek Vasut Nov. 1, 2022, 8:26 p.m. UTC
Use the FAILIF() macro consistently to avoid unused variable n warnings.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 tools/hciattach_qualcomm.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

Comments

patchwork-bot+bluetooth@kernel.org Nov. 1, 2022, 9:10 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue,  1 Nov 2022 21:26:36 +0100 you wrote:
> Use the FAILIF() macro consistently to avoid unused variable n warnings.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
>  tools/hciattach_qualcomm.c | 24 ++++++++----------------
>  1 file changed, 8 insertions(+), 16 deletions(-)

Here is the summary with links:
  - [BlueZ] tools: Switch hciattach_qualcomm to FAILIF macro completely
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f9657b86ddd3

You are awesome, thank you!
bluez.test.bot@gmail.com Nov. 1, 2022, 9:21 p.m. UTC | #2
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=690948

---Test result---

Test Summary:
CheckPatch                    PASS      1.14 seconds
GitLint                       PASS      0.76 seconds
Prep - Setup ELL              PASS      26.29 seconds
Build - Prep                  PASS      0.71 seconds
Build - Configure             PASS      8.19 seconds
Build - Make                  PASS      731.42 seconds
Make Check                    PASS      11.41 seconds
Make Check w/Valgrind         PASS      289.30 seconds
Make Distcheck                PASS      237.17 seconds
Build w/ext ELL - Configure   PASS      8.27 seconds
Build w/ext ELL - Make        PASS      84.31 seconds
Incremental Build w/ patches  PASS      0.00 seconds
Scan Build                    PASS      471.06 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
index d228aeec0..d751f42b1 100644
--- a/tools/hciattach_qualcomm.c
+++ b/tools/hciattach_qualcomm.c
@@ -175,10 +175,8 @@  int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
 		}
 
 		/* Read reply. */
-		if (read_hci_event(fd, resp, 100) < 0) {
-			perror("Failed to read init response");
-			return -1;
-		}
+		n = read_hci_event(fd, resp, 100);
+		FAILIF(n < 0, "Failed to read init response");
 
 		/* Wait for command complete event for our Opcode */
 	} while (resp[4] != cmd[1] && resp[5] != cmd[2]);
@@ -215,10 +213,8 @@  int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
 		}
 
 		/* Read reply. */
-		if ((n = read_hci_event(fd, resp, 100)) < 0) {
-			perror("Failed to read vendor init response");
-			return -1;
-		}
+		n = read_hci_event(fd, resp, 100);
+		FAILIF(n < 0, "Failed to read vendor init response");
 
 	} while (resp[3] != 0 && resp[4] != 2);
 
@@ -229,10 +225,8 @@  int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
 				resp[32], resp[33], resp[34], resp[35]);
 
 	/* Wait for command complete event for our Opcode */
-	if (read_hci_event(fd, resp, 100) < 0) {
-		perror("Failed to read init response");
-		return -1;
-	}
+	n = read_hci_event(fd, resp, 100);
+	FAILIF(n < 0, "Failed to read init response");
 
 	qualcomm_load_firmware(fd, fw, bdaddr);
 
@@ -250,10 +244,8 @@  int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
 		}
 
 		/* Read reply. */
-		if ((n = read_hci_event(fd, resp, 100)) < 0) {
-			perror("Failed to read reset response");
-			return -1;
-		}
+		n = read_hci_event(fd, resp, 100);
+		FAILIF(n < 0, "Failed to read reset response");
 
 	} while (resp[4] != cmd[1] && resp[5] != cmd[2]);