nimble/l2cap: Remove not needed checks Minor change removing not needed check for return code.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e9bb23e6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e9bb23e6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e9bb23e6 Branch: refs/heads/develop Commit: e9bb23e6176a55bd4897f6b8bd2213c87a04f0d6 Parents: 82c6878 Author: Åukasz Rymanowski <[email protected]> Authored: Tue Jan 17 15:37:30 2017 +0100 Committer: Åukasz Rymanowski <[email protected]> Committed: Thu Feb 2 12:59:59 2017 +0100 ---------------------------------------------------------------------- net/nimble/host/src/ble_l2cap_sig_cmd.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9bb23e6/net/nimble/host/src/ble_l2cap_sig_cmd.c ---------------------------------------------------------------------- diff --git a/net/nimble/host/src/ble_l2cap_sig_cmd.c b/net/nimble/host/src/ble_l2cap_sig_cmd.c index 7458210..6b58f92 100644 --- a/net/nimble/host/src/ble_l2cap_sig_cmd.c +++ b/net/nimble/host/src/ble_l2cap_sig_cmd.c @@ -138,20 +138,13 @@ ble_l2cap_sig_reject_tx(uint16_t conn_handle, uint8_t id, uint16_t reason, data, data_len); STATS_INC(ble_l2cap_stats, sig_rx); - rc = ble_l2cap_sig_tx(conn_handle, txom); - if (rc != 0) { - return rc; - } - - return 0; + return ble_l2cap_sig_tx(conn_handle, txom); } int ble_l2cap_sig_reject_invalid_cid_tx(uint16_t conn_handle, uint8_t id, uint16_t src_cid, uint16_t dst_cid) { - int rc; - struct { uint16_t local_cid; uint16_t remote_cid; @@ -160,10 +153,9 @@ ble_l2cap_sig_reject_invalid_cid_tx(uint16_t conn_handle, uint8_t id, .remote_cid = src_cid, }; - rc = ble_l2cap_sig_reject_tx(conn_handle, id, + return ble_l2cap_sig_reject_tx(conn_handle, id, BLE_L2CAP_SIG_ERR_INVALID_CID, &data, sizeof data); - return rc; } static void @@ -210,12 +202,7 @@ ble_l2cap_sig_update_req_tx(uint16_t conn_handle, uint8_t id, ble_l2cap_sig_update_req_write(payload_buf, BLE_L2CAP_SIG_UPDATE_REQ_SZ, req); - rc = ble_l2cap_sig_tx(conn_handle, txom); - if (rc != 0) { - return rc; - } - - return 0; + return ble_l2cap_sig_tx(conn_handle, txom); } static void @@ -260,10 +247,5 @@ ble_l2cap_sig_update_rsp_tx(uint16_t conn_handle, uint8_t id, uint16_t result) ble_l2cap_sig_update_rsp_write(payload_buf, BLE_L2CAP_SIG_UPDATE_RSP_SZ, &rsp); - rc = ble_l2cap_sig_tx(conn_handle, txom); - if (rc != 0) { - return rc; - } - - return 0; + return ble_l2cap_sig_tx(conn_handle, txom); }
