[riot-notifications] [RIOT-OS/RIOT] [WIP] automatically set GNRC_NETIF_NUMOF (#12308)

benpicco notifications at github.com
Thu Sep 26 19:40:08 CEST 2019


### Contribution description
Currently, `GNRC_NETIF_NUMOF` has to be set manually.
This PR changes that so that each network interface will increment `GNRC_NETIF_NUMOF` at compile-time.

Since `GNRC_NETIF_NUMOF` now consists of `0 + 0 + sizeof(…) + 0 + sizeof(…) + …` the processor can not evaluate it anymore. This is not a problem since the compiler will see the same job if it sees an `if (0)`.
But as a prerequisite, many `#if (GNRC_NETIF_NUMOF > 0)` had to be changed into `if (GNRC_NETIF_NUMOF > 0)`.

As expected, code size did not increase.

### Testing procedure

Check if everything still works, especially examples/tests that define `GNRC_NETIF_NUMOF := 2`

### Issues/PRs references
#11979
#9903
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/12308

-- Commit Summary --

  * sys/net/gnrc: let the compiler evaluate GNRC_NETIF_NUMOF
  * [WIP] automatically set GNRC_NETIF_NUMOF

-- File Changes --

    M Makefile.include (7)
    M sys/auto_init/netif/auto_init_at86rf2xx.c (2)
    M sys/auto_init/netif/auto_init_cc110x.c (5)
    M sys/auto_init/netif/auto_init_cc2420.c (5)
    M sys/auto_init/netif/auto_init_enc28j60.c (5)
    M sys/auto_init/netif/auto_init_kw2xrf.c (2)
    M sys/auto_init/netif/auto_init_mrf24j40.c (2)
    M sys/auto_init/netif/auto_init_slipdev.c (2)
    M sys/auto_init/netif/auto_init_sx127x.c (5)
    M sys/auto_init/netif/auto_init_w5100.c (5)
    M sys/auto_init/netif/auto_init_xbee.c (5)
    A sys/include/auto_init_netif.h (138)
    M sys/include/net/gnrc/netif.h (3)
    M sys/include/net/gnrc/netif/internal.h (49)
    M sys/net/gnrc/application_layer/tftp/gnrc_tftp.c (4)
    M sys/net/gnrc/netif/gnrc_netif.c (21)
    M sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c (86)
    M sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c (56)
    M sys/net/gnrc/sock/include/gnrc_sock_internal.h (7)
    M sys/shell/commands/sc_gnrc_icmpv6_echo.c (4)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12308.patch
https://github.com/RIOT-OS/RIOT/pull/12308.diff

-- 
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/12308
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190926/f81b58b2/attachment.htm>


More information about the notifications mailing list