From 5e3f7e35f1647b1bae5be461516a4a7d38a697e6 Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Tue, 22 Jun 2021 15:52:45 +0200 Subject: [PATCH] gnrc_netif/auto_init_*: avoid explicit cast to netdev --- sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c | 6 +++--- sys/net/gnrc/netif/init_devs/auto_init_atwinc15x0.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_cc110x.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_cc2420.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_dose.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_enc28j60.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_encx24j600.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_ethos.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c | 6 +++--- sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_nrf24l01p_ng.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_slipdev.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c | 2 +- sys/net/gnrc/netif/init_devs/auto_init_sx126x.c | 4 ++-- sys/net/gnrc/netif/init_devs/auto_init_sx127x.c | 4 ++-- sys/net/gnrc/netif/init_devs/auto_init_w5100.c | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c b/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c index 7398539214..f29b1a5ca0 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c @@ -57,17 +57,17 @@ void auto_init_at86rf2xx(void) gnrc_netif_gomach_create(&_netif[i], _at86rf2xx_stacks[i], AT86RF2XX_MAC_STACKSIZE, AT86RF2XX_MAC_PRIO, "at86rf2xx-gomach", - (netdev_t *)&at86rf2xx_devs[i]); + &at86rf2xx_devs[i].netdev.netdev); #elif defined(MODULE_GNRC_LWMAC) gnrc_netif_lwmac_create(&_netif[i], _at86rf2xx_stacks[i], AT86RF2XX_MAC_STACKSIZE, AT86RF2XX_MAC_PRIO, "at86rf2xx-lwmac", - (netdev_t *)&at86rf2xx_devs[i]); + &at86rf2xx_devs[i].netdev.netdev); #else gnrc_netif_ieee802154_create(&_netif[i], _at86rf2xx_stacks[i], AT86RF2XX_MAC_STACKSIZE, AT86RF2XX_MAC_PRIO, "at86rf2xx", - (netdev_t *)&at86rf2xx_devs[i]); + &at86rf2xx_devs[i].netdev.netdev); #endif } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_atwinc15x0.c b/sys/net/gnrc/netif/init_devs/auto_init_atwinc15x0.c index 60b5b25b08..edb338d17f 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_atwinc15x0.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_atwinc15x0.c @@ -63,7 +63,7 @@ void auto_init_atwinc15x0(void) gnrc_netif_ethernet_create(&_netif[i], stack[i], ATWINC15X0_MAC_STACKSIZE, ATWINC15X0_MAC_PRIO, "atwinc15x0", - (netdev_t *)&dev[i]); + &dev[i].netdev); } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_cc110x.c b/sys/net/gnrc/netif/init_devs/auto_init_cc110x.c index c6e0ef0689..d5a85f3a1e 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_cc110x.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_cc110x.c @@ -75,7 +75,7 @@ void auto_init_cc110x(void) cc110x_setup(&_cc110x_devs[i], &cc110x_params[i], i); gnrc_netif_cc1xxx_create(&_netif[i], stacks[i], CC110X_MAC_STACKSIZE, CC110X_MAC_PRIO, - "cc110x", (netdev_t *)&_cc110x_devs[i]); + "cc110x", &_cc110x_devs[i].netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c b/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c index a21824eeba..fb0eff7efb 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c @@ -60,7 +60,7 @@ void auto_init_cc2420(void) cc2420_setup(&cc2420_devs[i], &cc2420_params[i], i); gnrc_netif_ieee802154_create(&_netif[i], _cc2420_stacks[i], CC2420_MAC_STACKSIZE, CC2420_MAC_PRIO, "cc2420", - (netdev_t *)&cc2420_devs[i]); + &cc2420_devs[i].netdev.netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c b/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c index eec5a5d539..3e68fb82c3 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c @@ -44,6 +44,6 @@ void auto_init_cc2538_rf(void) gnrc_netif_ieee802154_create(&_netif, _cc2538_rf_stack, CC2538_MAC_STACKSIZE, CC2538_MAC_PRIO, "cc2538_rf", - (netdev_t *)&cc2538_rf_dev); + &cc2538_rf_dev.netdev.dev.netdev); } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_dose.c b/sys/net/gnrc/netif/init_devs/auto_init_dose.c index 11e0dc636d..fa56a5edc8 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_dose.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_dose.c @@ -46,7 +46,7 @@ void auto_init_dose(void) dose_setup(&dose[i], &dose_params[i], i); gnrc_netif_ethernet_create(&_netif[i], _netdev_eth_stack[i], DOSE_MAC_STACKSIZE, - DOSE_MAC_PRIO, "dose", (netdev_t *)&dose[i]); + DOSE_MAC_PRIO, "dose", &dose[i].netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_enc28j60.c b/sys/net/gnrc/netif/init_devs/auto_init_enc28j60.c index f2b66905d5..691acd8e5e 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_enc28j60.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_enc28j60.c @@ -63,7 +63,7 @@ void auto_init_enc28j60(void) enc28j60_setup(&dev[i], &enc28j60_params[i], i); gnrc_netif_ethernet_create(&_netif[i], stack[i], ENC28J60_MAC_STACKSIZE, ENC28J60_MAC_PRIO, "enc28j60", - (netdev_t *)&dev[i]); + &dev[i].netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_encx24j600.c b/sys/net/gnrc/netif/init_devs/auto_init_encx24j600.c index 1c32df4e22..f7660468d6 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_encx24j600.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_encx24j600.c @@ -53,6 +53,6 @@ void auto_init_encx24j600(void) /* initialize netdev<->gnrc adapter state */ gnrc_netif_ethernet_create(&_netif, _netdev_eth_stack, ENCX24J600_MAC_STACKSIZE, ENCX24J600_MAC_PRIO, "encx24j600", - (netdev_t *)&encx24j600); + &encx24j600.netdev); } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_ethos.c b/sys/net/gnrc/netif/init_devs/auto_init_ethos.c index 79e4fe64ca..65629bffe8 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_ethos.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_ethos.c @@ -59,7 +59,7 @@ void auto_init_ethos(void) /* initialize netdev<->gnrc adapter state */ gnrc_netif_ethernet_create(&_netif[i], _netdev_eth_stack[i], ETHOS_MAC_STACKSIZE, - ETHOS_MAC_PRIO, "ethos", (netdev_t *)ðos[i]); + ETHOS_MAC_PRIO, "ethos", ðos[i].netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c b/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c index 8ec90ef180..bbfa53ade1 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c @@ -54,7 +54,7 @@ void auto_init_kw2xrf(void) kw2xrf_setup(&kw2xrf_devs[i], (kw2xrf_params_t*) p); gnrc_netif_ieee802154_create(&_netif[i], _kw2xrf_stacks[i], KW2XRF_MAC_STACKSIZE, KW2XRF_MAC_PRIO, "kw2xrf", - (netdev_t *)&kw2xrf_devs[i]); + &kw2xrf_devs[i].netdev.netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c b/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c index b3966f352c..a22d18a3a1 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c @@ -62,15 +62,15 @@ void auto_init_kw41zrf(void) #if defined(MODULE_GNRC_GOMACH) gnrc_netif_gomach_create(&_netif[i], _kw41zrf_stacks[i], KW41ZRF_NETIF_STACKSIZE, KW41ZRF_NETIF_PRIO, "kw41zrf-gomach", - (netdev_t *)&kw41zrf_devs[i]); + &kw41zrf_devs[i].netdev.netdev); #elif defined(MODULE_GNRC_LWMAC) gnrc_netif_lwmac_create(&_netif[i], _kw41zrf_stacks[i], KW41ZRF_NETIF_STACKSIZE, KW41ZRF_NETIF_PRIO, "kw41zrf-lwmac", - (netdev_t *)&kw41zrf_devs[i]); + &kw41zrf_devs[i].netdev.netdev); #else gnrc_netif_ieee802154_create(&_netif[i], _kw41zrf_stacks[i], KW41ZRF_NETIF_STACKSIZE, KW41ZRF_NETIF_PRIO, "kw41zrf", - (netdev_t *)&kw41zrf_devs[i]); + &kw41zrf_devs[i].netdev.netdev); #endif } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c b/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c index 00d9ea921a..adb3910501 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c @@ -51,7 +51,7 @@ void auto_init_mrf24j40(void) gnrc_netif_ieee802154_create(&_netif[i], _mrf24j40_stacks[i], MRF24J40_MAC_STACKSIZE, MRF24J40_MAC_PRIO, "mrf24j40", - (netdev_t *)&mrf24j40_devs[i]); + &mrf24j40_devs[i].netdev.netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_nrf24l01p_ng.c b/sys/net/gnrc/netif/init_devs/auto_init_nrf24l01p_ng.c index 2aae0e4306..9724505f56 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_nrf24l01p_ng.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_nrf24l01p_ng.c @@ -77,7 +77,7 @@ void auto_init_nrf24l01p_ng(void) NRF24L01P_NG_MAC_STACKSIZE, NRF24L01P_NG_MAC_PRIO, "nrf24l01p_ng", - (netdev_t *)&_nrf24l01p_ng_devs[i]); + &_nrf24l01p_ng_devs[i].netdev); } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c b/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c index 1657f825e6..025162f860 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c @@ -48,6 +48,6 @@ void auto_init_nrf802154(void) gnrc_netif_ieee802154_create(&_netif, _stack, NRF802154_MAC_STACKSIZE, NRF802154_MAC_PRIO, "nrf802154", - (netdev_t *)&nrf802154_dev); + &nrf802154_dev.netdev.dev.netdev); } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_slipdev.c b/sys/net/gnrc/netif/init_devs/auto_init_slipdev.c index 2dca489e59..844b2f1130 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_slipdev.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_slipdev.c @@ -51,7 +51,7 @@ void auto_init_slipdev(void) slipdev_setup(&slipdevs[i], p, i); gnrc_netif_raw_create(&_netif[i], _slipdev_stacks[i], SLIPDEV_STACKSIZE, SLIPDEV_PRIO, "slipdev", - (netdev_t *)&slipdevs[i]); + &slipdevs[i].netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c b/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c index c57ba7de33..8f8c8795f2 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c @@ -50,7 +50,7 @@ void auto_init_socket_zep(void) gnrc_netif_ieee802154_create(&_netif[i], _socket_zep_stacks[i], SOCKET_ZEP_MAC_STACKSIZE, SOCKET_ZEP_MAC_PRIO, "socket_zep", - (netdev_t *)&_socket_zeps[i]); + &_socket_zeps[i].netdev.netdev); } } /** @} */ diff --git a/sys/net/gnrc/netif/init_devs/auto_init_sx126x.c b/sys/net/gnrc/netif/init_devs/auto_init_sx126x.c index b680a6848d..c278d5c9da 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_sx126x.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_sx126x.c @@ -59,12 +59,12 @@ void auto_init_sx126x(void) gnrc_netif_lorawan_create(&_netif[i], sx126x_stacks[i], SX126X_STACKSIZE, SX126X_PRIO, - "sx126x", (netdev_t *)&sx126x_devs[i]); + "sx126x", &sx126x_devs[i].netdev); } else { gnrc_netif_raw_create(&_netif[i], sx126x_stacks[i], SX126X_STACKSIZE, SX126X_PRIO, - "sx126x", (netdev_t *)&sx126x_devs[i]); + "sx126x", &sx126x_devs[i].netdev); } } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_sx127x.c b/sys/net/gnrc/netif/init_devs/auto_init_sx127x.c index f85427e433..74d99bde00 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_sx127x.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_sx127x.c @@ -64,12 +64,12 @@ void auto_init_sx127x(void) gnrc_netif_lorawan_create(&_netif[i], sx127x_stacks[i], SX127X_STACKSIZE, SX127X_PRIO, - "sx127x", (netdev_t *)&sx127x_devs[i]); + "sx127x", &sx127x_devs[i].netdev); } else { gnrc_netif_raw_create(&_netif[i], sx127x_stacks[i], SX127X_STACKSIZE, SX127X_PRIO, - "sx127x", (netdev_t *)&sx127x_devs[i]); + "sx127x", &sx127x_devs[i].netdev); } } } diff --git a/sys/net/gnrc/netif/init_devs/auto_init_w5100.c b/sys/net/gnrc/netif/init_devs/auto_init_w5100.c index 61258fa94d..983d142f4b 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_w5100.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_w5100.c @@ -59,7 +59,7 @@ void auto_init_w5100(void) w5100_setup(&dev[i], &w5100_params[i]); /* initialize netdev <-> gnrc adapter state */ gnrc_netif_ethernet_create(&_netif[i], stack[i], MAC_STACKSIZE, MAC_PRIO, "w5100", - (netdev_t *)&dev[i]); + &dev[i].nd); } } /** @} */