[ovs-dev] [PATCH] datapath: compat: Fix build on RHEL 7.5

Lucas Alvares Gomes lucasagomes at gmail.com
Fri May 11 08:34:17 UTC 2018


> diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
> index f48684b2e70f..90e76bac2165 100644
> --- a/datapath/vport-internal_dev.c
> +++ b/datapath/vport-internal_dev.c
> @@ -153,7 +153,7 @@ static const struct net_device_ops internal_dev_netdev_ops = {
>         .ndo_stop = internal_dev_stop,
>         .ndo_start_xmit = internal_dev_xmit,
>         .ndo_set_mac_address = eth_mac_addr,
> -#ifndef HAVE_NET_DEVICE_WITH_MAX_MTU
> +#if    !defined(HAVE_NET_DEVICE_WITH_MAX_MTU) && !defined(HAVE_RHEL7_MAX_MTU)
>         .ndo_change_mtu = internal_dev_change_mtu,
>  #endif
>         .ndo_get_stats64 = (void *)internal_get_stats,

On RHEL 7.5, internal_dev_change_mtu will not be used and the compiler
will throw a warning about it:

  CC [M]  /root/ovs/datapath/linux/vport-internal_dev.o
/root/ovs/datapath/linux/vport-internal_dev.c:92:12: warning:
‘internal_dev_change_mtu’ defined but not used [-Wunused-function]
 static int internal_dev_change_mtu(struct net_device *dev, int new_mtu)

Can we have the same conditional [0] around that function definition
to avoid such warning ?

Other than that the patch looks good to me, thank you!

[0]  #if    !defined(HAVE_NET_DEVICE_WITH_MAX_MTU) &&
!defined(HAVE_RHEL7_MAX_MTU)


More information about the dev mailing list