From 09e69912c16238667e3a1359ade488aa6165f7ea Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 3 Sep 2020 10:14:30 -0700 Subject: [PATCH] Remove def stack/l2cap/l2c_link::L2C_LINK_CHECK_POWER_MODE Unnecessary layer of indirection Towards readable code Bug: 163134718 Tag: #refactor Test: acts -tc BleCocTest Test: ble paired 2 phones Change-Id: I0e99b5df8fb0f2f678ae94320b1daaac78d606dd --- stack/l2cap/l2c_int.h | 1 - stack/l2cap/l2c_link.cc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h index 4f6047aad..fe4fbe6f9 100644 --- a/stack/l2cap/l2c_int.h +++ b/stack/l2cap/l2c_int.h @@ -652,7 +652,6 @@ extern void l2c_link_sec_comp2(const RawAddress& p_bda, tBT_TRANSPORT trasnport, extern void l2c_link_adjust_chnl_allocation(void); extern bool l2c_link_check_power_mode(tL2C_LCB* p_lcb); -#define L2C_LINK_CHECK_POWER_MODE(x) l2c_link_check_power_mode((x)) #if (L2CAP_CONFORMANCE_TESTING == TRUE) /* Used only for conformance testing */ diff --git a/stack/l2cap/l2c_link.cc b/stack/l2cap/l2c_link.cc index bc914a3bc..ce25980b0 100644 --- a/stack/l2cap/l2c_link.cc +++ b/stack/l2cap/l2c_link.cc @@ -912,7 +912,7 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid, if ((!p_lcb->in_use) || (p_lcb->partial_segment_being_sent) || (p_lcb->link_state != LST_CONNECTED) || - (p_lcb->link_xmit_quota != 0) || (L2C_LINK_CHECK_POWER_MODE(p_lcb))) + (p_lcb->link_xmit_quota != 0) || (l2c_link_check_power_mode(p_lcb))) continue; /* See if we can send anything from the Link Queue */ @@ -949,7 +949,7 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid, /* If a partial segment is being sent, can't send anything else */ if ((p_lcb->partial_segment_being_sent) || (p_lcb->link_state != LST_CONNECTED) || - (L2C_LINK_CHECK_POWER_MODE(p_lcb))) + (l2c_link_check_power_mode(p_lcb))) return; /* See if we can send anything from the link queue */ -- 2.11.0