Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble/ll: only let ble_ll.c add/remove to ll_evq #1257

Merged
merged 1 commit into from May 16, 2022

Conversation

bvdberg
Copy link
Contributor

@bvdberg bvdberg commented May 13, 2022

  • change all ble_npl_eventq_put(&g_ble_ll_data.ll_evq, ..) -> ble_ll_event_add(..)
  • change all ble_npl_eventq_remove(&g_ble_ll_data.ll_evq, ..) -> ble_ll_event_remove(..)
  • rename ble_ll_event_send -> ble_ll_event_add (matches more with remove)

- change all ble_npl_eventq_put(&g_ble_ll_data.ll_evq, ..) -> ble_ll_event_add(..)
- change all ble_npl_eventq_remove(&g_ble_ll_data.ll_evq, ..) -> ble_ll_event_remove(..)
- rename ble_ll_event_send -> ble_ll_event_add (matches more with remove)
@utzig
Copy link
Member

utzig commented May 13, 2022

Style check summary

Our coding style is here!

nimble/controller/src/ble_ll_dtm.c

@@ -197,7 +196,8 @@
 static int ble_ll_dtm_rx_start(void);
 
 static void
-ble_ll_dtm_ev_rx_restart_cb(struct ble_npl_event *evt) {
+ble_ll_dtm_ev_rx_restart_cb(struct ble_npl_event *evt)
+{
     if (ble_ll_dtm_rx_start() != 0) {
         ble_ll_event_add(&g_ble_ll_dtm_ctx.evt);
         STATS_INC(ble_ll_dtm_stats, rx_failed);

nimble/controller/src/ble_ll_sched.c

@@ -142,36 +142,36 @@
 
         switch (entry->sched_type) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL) || MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            case BLE_LL_SCHED_TYPE_CONN:
-                connsm = (struct ble_ll_conn_sm *)entry->cb_arg;
-                ble_ll_event_add(&connsm->conn_ev_end);
-                break;
+        case BLE_LL_SCHED_TYPE_CONN:
+            connsm = (struct ble_ll_conn_sm *)entry->cb_arg;
+            ble_ll_event_add(&connsm->conn_ev_end);
+            break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER)
-            case BLE_LL_SCHED_TYPE_ADV:
-                ble_ll_adv_event_rmvd_from_sched(entry->cb_arg);
-                break;
+        case BLE_LL_SCHED_TYPE_ADV:
+            ble_ll_adv_event_rmvd_from_sched(entry->cb_arg);
+            break;
 #endif
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) && MYNEWT_VAL(BLE_LL_ROLE_OBSERVER)
-            case BLE_LL_SCHED_TYPE_SCAN_AUX:
-                ble_ll_scan_aux_break(entry->cb_arg);
-                break;
+        case BLE_LL_SCHED_TYPE_SCAN_AUX:
+            ble_ll_scan_aux_break(entry->cb_arg);
+            break;
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV)
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER)
-            case BLE_LL_SCHED_TYPE_PERIODIC:
-                ble_ll_adv_periodic_rmvd_from_sched(entry->cb_arg);
-                break;
+        case BLE_LL_SCHED_TYPE_PERIODIC:
+            ble_ll_adv_periodic_rmvd_from_sched(entry->cb_arg);
+            break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_OBSERVER)
-            case BLE_LL_SCHED_TYPE_SYNC:
-                ble_ll_sync_rmvd_from_sched(entry->cb_arg);
-                break;
-#endif
-#endif
-#endif
-            default:
-                BLE_LL_ASSERT(0);
-                break;
+        case BLE_LL_SCHED_TYPE_SYNC:
+            ble_ll_sync_rmvd_from_sched(entry->cb_arg);
+            break;
+#endif
+#endif
+#endif
+        default:
+            BLE_LL_ASSERT(0);
+            break;
         }
 
         entry = next;

@bvdberg
Copy link
Contributor Author

bvdberg commented May 16, 2022

The patch didn't change most of those lines, so why does the Style check fail now? Is there a tool I can use the automatically set the style? (like astyle / clang-format?)

@sjanc
Copy link
Contributor

sjanc commented May 16, 2022

we need to tune it a bit better, this is informative (ie it doesn't block merge) so you may ignore those for now

@sjanc sjanc merged commit 1e63bdb into apache:master May 16, 2022
@bvdberg bvdberg deleted the bb_ll_evq_cleanup branch May 17, 2022 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants