[riot-notifications] [RIOT-OS/RIOT] tree-wide: avoid explicit cast to netdev (#16577)

benpicco notifications at github.com
Thu Jul 8 15:04:34 CEST 2021


@benpicco commented on this pull request.



> + *
+ * @return  pointer to the netdev descriptor. NULL if there's none.
+ */
+static inline cc2538_rf_t *netdev_to_cc2538_rf(netdev_t *netdev)
+{
+    /* Ugly... but at least type safe */
+#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
+    return container_of(container_of(container_of(netdev,
+                                                  netdev_ieee802154_t,
+                                                  netdev),
+                                     netdev_ieee802154_submac_t,
+                                     dev
+                                     ),
+                        cc2538_rf_t,
+                        netdev);
+#elif IS_USED(MODULE_CC2538_RF_NETDEV_LEGACY)

should we just drop the legacy driver? 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16577#pullrequestreview-702035374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210708/278f7a2b/attachment.htm>


More information about the notifications mailing list