You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by gi...@git.apache.org on 2017/07/11 08:07:48 UTC

[GitHub] sjanc commented on a change in pull request #398: [RFC] Fixes for possible issues found with clang-check

sjanc commented on a change in pull request #398: [RFC] Fixes for possible issues found with clang-check
URL: https://github.com/apache/mynewt-core/pull/398#discussion_r126621189
 
 

 ##########
 File path: net/nimble/controller/src/ble_ll_ctrl.c
 ##########
 @@ -630,12 +630,20 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         CONN_F_PHY_UPDATE_SCHED(connsm) = 1;
 
         /* Set new phys to use when instant occurs */
-        connsm->phy_data.new_tx_phy = m_to_s;
-        connsm->phy_data.new_rx_phy = s_to_m;
-
         /* Convert m_to_s and s_to_m to masks */
-        m_to_s = 1 << (m_to_s - 1);
-        s_to_m = 1 << (s_to_m - 1);
+        if (m_to_s != 0) {
 
 Review comment:
   I'd leave assignment unconditional and only make conversions under
   connsm->phy_data.new_tx_phy = m_to_s;
   connsm->phy_data.new_rx_phy = s_to_m;
   
   if (m_to_s) {
     m_to_s = 1 << (m_to_s - 1);
   }
   
   if (s_to_m) {
       s_to_m = 1 << (s_to_m - 1);
   }
   
   
   
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services