From: Yu Watanabe Date: Mon, 16 Aug 2021 14:47:40 +0000 (+0900) Subject: ethtool: make the size of 'features' array static X-Git-Tag: v250-rc1~823^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0db68800c756f298ef45584ac01915c2cb2ce359;p=thirdparty%2Fsystemd.git ethtool: make the size of 'features' array static --- diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index f77f6943ca4..699c7a97ab9 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -501,7 +501,7 @@ static int set_features_bit( return found ? 0 : -ENODATA; } -int ethtool_set_features(int *ethtool_fd, const char *ifname, const int *features) { +int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features[static _NET_DEV_FEAT_MAX]) { _cleanup_free_ struct ethtool_gstrings *strings = NULL; struct ethtool_sfeatures *sfeatures; struct ifreq ifr = {}; diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 7d287666249..f0fc40b0595 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -88,7 +88,7 @@ int ethtool_get_link_info(int *ethtool_fd, const char *ifname, int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct ether_addr *ret); int ethtool_set_wol(int *ethtool_fd, const char *ifname, uint32_t wolopts); int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, const netdev_ring_param *ring); -int ethtool_set_features(int *ethtool_fd, const char *ifname, const int *features); +int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features[static _NET_DEV_FEAT_MAX]); int ethtool_set_glinksettings(int *ethtool_fd, const char *ifname, int autonegotiation, const uint32_t advertise[static N_ADVERTISE], uint64_t speed, Duplex duplex, NetDevPort port);