diff mbox series

[BlueZ] tools: Make hciattach_* firmware path build-time configurable

Message ID 20221101115333.18223-1-marex@denx.de
State New
Headers show
Series [BlueZ] tools: Make hciattach_* firmware path build-time configurable | expand

Commit Message

Marek Vasut Nov. 1, 2022, 11:53 a.m. UTC
Make hciattach_qualcomm.c and hciattach_tialt.c behave the same way
as hciattach_bcm43xx.c does, where FIRMWARE_DIR can be overridden
at build time by using -DFIRMWARE_DIR= CFLAGS.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 tools/hciattach.h          | 4 ++++
 tools/hciattach_bcm43xx.c  | 4 ----
 tools/hciattach_qualcomm.c | 3 ++-
 tools/hciattach_tialt.c    | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)

Comments

bluez.test.bot@gmail.com Nov. 1, 2022, 1:37 p.m. UTC | #1
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=690839

---Test result---

Test Summary:
CheckPatch                    PASS      1.01 seconds
GitLint                       PASS      0.86 seconds
Prep - Setup ELL              PASS      26.44 seconds
Build - Prep                  PASS      0.68 seconds
Build - Configure             PASS      8.16 seconds
Build - Make                  PASS      723.76 seconds
Make Check                    PASS      10.90 seconds
Make Check w/Valgrind         PASS      287.82 seconds
Make Distcheck                PASS      233.70 seconds
Build w/ext ELL - Configure   PASS      8.17 seconds
Build w/ext ELL - Make        PASS      83.94 seconds
Incremental Build w/ patches  PASS      0.00 seconds
Scan Build                    WARNING   476.19 seconds

Details
##############################
Test: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
                if ((n = read_hci_event(fd, resp, 100)) < 0) {
                     ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
                if ((n = read_hci_event(fd, resp, 100)) < 0) {
                     ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.




---
Regards,
Linux Bluetooth
Marek Vasut Nov. 1, 2022, 3:19 p.m. UTC | #2
On 11/1/22 14:37, bluez.test.bot@gmail.com wrote:
> 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=690839
> 
> ---Test result---
> 
> Test Summary:
> CheckPatch                    PASS      1.01 seconds
> GitLint                       PASS      0.86 seconds
> Prep - Setup ELL              PASS      26.44 seconds
> Build - Prep                  PASS      0.68 seconds
> Build - Configure             PASS      8.16 seconds
> Build - Make                  PASS      723.76 seconds
> Make Check                    PASS      10.90 seconds
> Make Check w/Valgrind         PASS      287.82 seconds
> Make Distcheck                PASS      233.70 seconds
> Build w/ext ELL - Configure   PASS      8.17 seconds
> Build w/ext ELL - Make        PASS      83.94 seconds
> Incremental Build w/ patches  PASS      0.00 seconds
> Scan Build                    WARNING   476.19 seconds
> 
> Details
> ##############################
> Test: Scan Build - WARNING
> Desc: Run Scan Build with patches
> Output:
> *****************************************************************************
> The bugs reported by the scan-build may or may not be caused by your patches.
> Please check the list and fix the bugs if they are caused by your patch.
> *****************************************************************************
> tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
>                  if ((n = read_hci_event(fd, resp, 100)) < 0) {
>                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
>                  if ((n = read_hci_event(fd, resp, 100)) < 0) {
>                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2 warnings generated.

That's unlikely caused by this patch.
Luiz Augusto von Dentz Nov. 1, 2022, 7:24 p.m. UTC | #3
Hi Marek,

On Tue, Nov 1, 2022 at 8:45 AM Marek Vasut <marex@denx.de> wrote:
>
> On 11/1/22 14:37, bluez.test.bot@gmail.com wrote:
> > 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=690839
> >
> > ---Test result---
> >
> > Test Summary:
> > CheckPatch                    PASS      1.01 seconds
> > GitLint                       PASS      0.86 seconds
> > Prep - Setup ELL              PASS      26.44 seconds
> > Build - Prep                  PASS      0.68 seconds
> > Build - Configure             PASS      8.16 seconds
> > Build - Make                  PASS      723.76 seconds
> > Make Check                    PASS      10.90 seconds
> > Make Check w/Valgrind         PASS      287.82 seconds
> > Make Distcheck                PASS      233.70 seconds
> > Build w/ext ELL - Configure   PASS      8.17 seconds
> > Build w/ext ELL - Make        PASS      83.94 seconds
> > Incremental Build w/ patches  PASS      0.00 seconds
> > Scan Build                    WARNING   476.19 seconds
> >
> > Details
> > ##############################
> > Test: Scan Build - WARNING
> > Desc: Run Scan Build with patches
> > Output:
> > *****************************************************************************
> > The bugs reported by the scan-build may or may not be caused by your patches.
> > Please check the list and fix the bugs if they are caused by your patch.
> > *****************************************************************************
> > tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> >                  if ((n = read_hci_event(fd, resp, 100)) < 0) {
> >                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> >                  if ((n = read_hci_event(fd, resp, 100)) < 0) {
> >                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 2 warnings generated.
>
> That's unlikely caused by this patch.

Yep, the scan-build rebuilds the file you have changed so any problem
it finds in that file will be reported, anyway I can ignore the
warnings but patches to fix these warnings are welcome as well.
diff mbox series

Patch

diff --git a/tools/hciattach.h b/tools/hciattach.h
index 26c0d5424..dfa4c1e7a 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -40,6 +40,10 @@ 
 #define HCI_UART_EXT_CONFIG	4
 #define HCI_UART_VND_DETECT	5
 
+#ifndef FIRMWARE_DIR
+#define FIRMWARE_DIR "/etc/firmware"
+#endif
+
 int read_hci_event(int fd, unsigned char *buf, int size);
 int set_speed(int fd, struct termios *ti, int speed);
 int uart_speed(int speed);
diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index dbb5a3fe3..b89fc1b50 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -30,10 +30,6 @@ 
 
 #include "hciattach.h"
 
-#ifndef FIRMWARE_DIR
-#define FIRMWARE_DIR "/etc/firmware"
-#endif
-
 #define FW_EXT ".hcd"
 
 #define BCM43XX_CLOCK_48 1
diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
index 77b6db170..d228aeec0 100644
--- a/tools/hciattach_qualcomm.c
+++ b/tools/hciattach_qualcomm.c
@@ -222,7 +222,8 @@  int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
 
 	} while (resp[3] != 0 && resp[4] != 2);
 
-	snprintf(fw, sizeof(fw), "/etc/firmware/%c%c%c%c%c%c_%c%c%c%c.bin",
+	snprintf(fw, sizeof(fw), "%s/%c%c%c%c%c%c_%c%c%c%c.bin",
+				FIRMWARE_DIR,
 				resp[18], resp[19], resp[20], resp[21],
 				resp[22], resp[23],
 				resp[32], resp[33], resp[34], resp[35]);
diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c
index 4f7fd42a3..bf6e84923 100644
--- a/tools/hciattach_tialt.c
+++ b/tools/hciattach_tialt.c
@@ -221,7 +221,8 @@  int texasalt_init(int fd, int speed, struct termios *ti)
 				((brf_chip > 7) ? "unknown" : c_brf_chip[brf_chip]),
 				brf_chip);
 
-		sprintf(fw, "/etc/firmware/%s.bin",
+		sprintf(fw, "%s/%s.bin",
+			FIRMWARE_DIR,
 			(brf_chip > 7) ? "unknown" : c_brf_chip[brf_chip]);
 		texas_load_firmware(fd, fw);