From cadc7ed2e2720f39725647fd6f26be15afecc718 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 15 Sep 2020 10:40:54 +0900 Subject: [PATCH] ethtool: constify arguments for ethtool_set_xxx() --- src/shared/ethtool-util.c | 8 ++++---- src/shared/ethtool-util.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index 9326d2856e..adbf8d1db3 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -414,7 +414,7 @@ int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol) { return 0; } -int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring_param *ring) { +int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, const netdev_ring_param *ring) { struct ethtool_ringparam ecmd = { .cmd = ETHTOOL_GRINGPARAM }; @@ -543,7 +543,7 @@ static int set_features_bit( return found ? 0 : -ENODATA; } -int ethtool_set_features(int *ethtool_fd, const char *ifname, int *features) { +int ethtool_set_features(int *ethtool_fd, const char *ifname, const int *features) { _cleanup_free_ struct ethtool_gstrings *strings = NULL; struct ethtool_sfeatures *sfeatures; struct ifreq ifr = {}; @@ -754,7 +754,7 @@ int ethtool_set_glinksettings( int *fd, const char *ifname, int autonegotiation, - uint32_t advertise[static N_ADVERTISE], + const uint32_t advertise[static N_ADVERTISE], uint64_t speed, Duplex duplex, NetDevPort port) { @@ -813,7 +813,7 @@ int ethtool_set_glinksettings( return r; } -int ethtool_set_channels(int *fd, const char *ifname, netdev_channels *channels) { +int ethtool_set_channels(int *fd, const char *ifname, const netdev_channels *channels) { struct ethtool_channels ecmd = { .cmd = ETHTOOL_GCHANNELS }; diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 4730241708..9e3f1ed51a 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -101,12 +101,12 @@ 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_speed(int *ethtool_fd, const char *ifname, unsigned speed, Duplex duplex); int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol); -int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring_param *ring); -int ethtool_set_features(int *ethtool_fd, const char *ifname, int *features); +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_glinksettings(int *ethtool_fd, const char *ifname, - int autonegotiation, uint32_t advertise[static N_ADVERTISE], + int autonegotiation, const uint32_t advertise[static N_ADVERTISE], uint64_t speed, Duplex duplex, NetDevPort port); -int ethtool_set_channels(int *ethtool_fd, const char *ifname, netdev_channels *channels); +int ethtool_set_channels(int *ethtool_fd, const char *ifname, const netdev_channels *channels); int ethtool_set_flow_control(int *fd, const char *ifname, int rx, int tx, int autoneg); const char *duplex_to_string(Duplex d) _const_;