summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-11-01 21:26:36 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-11-01 14:02:07 -0700
commitf9657b86ddd3008768b3f6fef2c94eec46d976b5 (patch)
treec0c07802af806dc68c0e69427c3aedaa964ea405 /tools
parentd9253248363b995e44c1f5e393ed1c7aa4ec81ce (diff)
downloadbluez-f9657b86ddd3008768b3f6fef2c94eec46d976b5.tar.gz
tools: Switch hciattach_qualcomm to FAILIF macro completely
Use the FAILIF() macro consistently to avoid unused variable n warnings.
Diffstat (limited to 'tools')
-rw-r--r--tools/hciattach_qualcomm.c24
1 files changed, 8 insertions, 16 deletions
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]);