OSDN Git Service

Remove def stack/l2cap/l2c_link::L2C_LINK_CHECK_POWER_MODE
authorChris Manton <cmanton@google.com>
Thu, 3 Sep 2020 17:14:30 +0000 (10:14 -0700)
committerChris Manton <cmanton@google.com>
Tue, 22 Sep 2020 20:20:27 +0000 (20:20 +0000)
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
stack/l2cap/l2c_link.cc

index 4f6047a..fe4fbe6 100644 (file)
@@ -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 */
index bc914a3..ce25980 100644 (file)
@@ -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 */