]> git.ipfire.org Git - thirdparty/systemd.git/commit
network: make DEFINE_NETDEV_CAST() assert on input and output
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2023 10:52:26 +0000 (12:52 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 22 Sep 2023 06:17:42 +0000 (08:17 +0200)
commit117843fe95f091df1ddc87aaa60f1a2a8698d120
treef08ffd0849bcd84fe704b79df4e76ae4b8e04e02
parent6c9935ba87de2b46259e11722687b02349b9d1fc
network: make DEFINE_NETDEV_CAST() assert on input and output

The macro used to return NULL if input was NULL or had the wrong type. Now
it asserts that input is nonnull and it has the expected type.

There are a few places where a missing or mismatched type was OK, but in a
majority of places, we would do both of the asserts. In various places we'd
only do one, but that was by ommission/mistake. So moving the asserts into the
macro allows us to save some lines.
23 files changed:
src/network/netdev/bareudp.c
src/network/netdev/batadv.c
src/network/netdev/bond.c
src/network/netdev/bridge.c
src/network/netdev/fou-tunnel.c
src/network/netdev/geneve.c
src/network/netdev/ipoib.c
src/network/netdev/ipvlan.c
src/network/netdev/l2tp-tunnel.c
src/network/netdev/macsec.c
src/network/netdev/macvlan.c
src/network/netdev/netdev.h
src/network/netdev/tunnel.c
src/network/netdev/veth.c
src/network/netdev/vlan.c
src/network/netdev/vrf.c
src/network/netdev/vxcan.c
src/network/netdev/vxlan.c
src/network/netdev/wireguard.c
src/network/netdev/wlan.c
src/network/netdev/xfrm.c
src/network/networkd-network.c
src/network/networkd-route.c