public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/hfp: Fix issues found by codacy
@ 2025-10-02 16:11 Frédéric Danis
  2025-10-02 17:53 ` [BlueZ] " bluez.test.bot
  2025-10-09 19:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2025-10-02 16:11 UTC (permalink / raw)
  To: linux-bluetooth

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(-)

diff --git a/src/shared/hfp.c b/src/shared/hfp.c
index 133bff248..94adccada 100644
--- a/src/shared/hfp.c
+++ b/src/shared/hfp.c
@@ -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);
-- 
2.43.0


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

end of thread, other threads:[~2025-10-09 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 16:11 [PATCH BlueZ] shared/hfp: Fix issues found by codacy Frédéric Danis
2025-10-02 17:53 ` [BlueZ] " bluez.test.bot
2025-10-09 19:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox