Skip to contentSkip to conversation

shared/hfp: Fix issues found by codacy

PATCH Applied Frédéric Danis 3 participants 3 messages Oct 2, 2025 – Oct 9, 2025 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shared/hfp: Fix issues found by codacy

Move debug string after check of hfp pointer.
Add missing argument in debug trace.

---
 src/shared/hfp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
src/shared/hfp.c +11 -11
index 133bff248..94adccada 100644
@@ -2391,11 +2391,11 @@ bool hfp_hf_session_register(struct hfp_hf *hfp,
 
 bool hfp_hf_session(struct hfp_hf *hfp)
 {
-	DBG(hfp, "");
-
 	if (!hfp)
 		return false;
 
+	DBG(hfp, "");
+
 	if (!hfp_hf_register(hfp, slc_brsf_cb, "+BRSF", hfp, NULL))
 		return false;
 
@@ -2407,15 +2407,15 @@ const char *hfp_hf_call_get_number(struct hfp_hf *hfp, uint id)
 {
 	struct hf_call *call;
 
-	DBG(hfp, "");
-
 	if (!hfp)
-		return false;
+		return NULL;
+
+	DBG(hfp, "");
 
 	call = queue_find(hfp->calls, call_id_match, UINT_TO_PTR(id));
 	if (!call) {
 		DBG(hfp, "hf: no call with id: %u", id);
-		return false;
+		return NULL;
 	}
 
 	return call->line_id;
@@ -2427,11 +2427,11 @@ bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
 {
 	struct hf_call *call;
 
-	DBG(hfp, "");
-
 	if (!hfp)
 		return false;
 
+	DBG(hfp, "");
+
 	call = queue_find(hfp->calls, call_id_match, UINT_TO_PTR(id));
 	if (!call) {
 		DBG(hfp, "hf: no call with id: %u", id);
@@ -2440,7 +2440,7 @@ bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
 
 	if (call->status != CALL_STATUS_INCOMING) {
 		DBG(hfp, "hf: %d not in incoming call state: %u",
-							call->status);
+							id, call->status);
 		return false;
 	}
 
@@ -2453,11 +2453,11 @@ bool hfp_hf_call_hangup(struct hfp_hf *hfp, uint id,
 {
 	struct hf_call *call;
 
-	DBG(hfp, "");
-
 	if (!hfp)
 		return false;
 
+	DBG(hfp, "");
+
 	call = queue_find(hfp->calls, call_id_match, UINT_TO_PTR(id));
 	if (!call) {
 		DBG(hfp, "hf: no call with id: %u", id);
Signature · 1 line
2.43.0
#1 lore raw

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=1008059

---Test result---

Test Summary:

CheckPatch                    PENDING   0.93 seconds
GitLint                       PENDING   0.43 seconds
BuildEll                      PASS      20.09 seconds
BluezMake                     PASS      2703.80 seconds
MakeCheck                     PASS      20.15 seconds
MakeDistcheck                 PASS      185.88 seconds
CheckValgrind                 PASS      237.01 seconds
CheckSmatch                   PASS      309.45 seconds
bluezmakeextell               PASS      127.31 seconds
IncrementalBuild              PENDING   0.33 seconds
ScanBuild                     PASS      909.99 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Frédéric Danis
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 5 lines · On Thu, 2 Oct 2025 18:11:19 +0200 you wrote:

Move debug string after check of hfp pointer.
Add missing argument in debug trace.

---
 src/shared/hfp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Here is the summary with links:
- [BlueZ] shared/hfp: Fix issues found by codacy

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=24c568a3b689

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html