This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new ecc1a6d17 nimble/host: Remove dead code from 
ble_l2cap_sig_coc_disconnect_cb
ecc1a6d17 is described below

commit ecc1a6d175c56d2b0f0ac8700651c92ef4571323
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Aug 6 15:45:42 2025 +0200

    nimble/host: Remove dead code from ble_l2cap_sig_coc_disconnect_cb
    
    This is static function and all callers pass valid proc so no need
    for runtime check (make it assert).
---
 nimble/host/src/ble_l2cap_sig.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c
index 0a3591cd4..2e356d2e4 100644
--- a/nimble/host/src/ble_l2cap_sig.c
+++ b/nimble/host/src/ble_l2cap_sig.c
@@ -1666,25 +1666,15 @@ static void
 ble_l2cap_sig_coc_disconnect_cb(struct ble_l2cap_sig_proc *proc, int status)
 {
     struct ble_l2cap_chan *chan;
-    struct ble_l2cap_event event;
     struct ble_hs_conn *conn;
 
-    if (!proc) {
-        return;
-    }
+    assert(proc);
 
-    memset(&event, 0, sizeof(event));
     chan = proc->disconnect.chan;
-
     if (!chan) {
         return;
     }
 
-    if (!chan->cb) {
-        goto done;
-    }
-
-done:
     ble_hs_lock();
     conn = ble_hs_conn_find_assert(chan->conn_handle);
     if (conn) {

Reply via email to