From: Tom Gundersen Date: Tue, 29 Oct 2013 15:10:54 +0000 (+0100) Subject: udev: link-config - use zero instead of memset X-Git-Tag: v209~1751 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=2a7e74e002d0df6d7021240d3310220bd19aa3fe udev: link-config - use zero instead of memset --- diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c index 4fad52b46..68ddd25a9 100644 --- a/src/udev/net/ethtool-util.c +++ b/src/udev/net/ethtool-util.c @@ -73,9 +73,10 @@ int ethtool_set_speed(int fd, const char *ifname, unsigned int speed, Duplex dup if (speed == 0 && duplex == _DUP_INVALID) return 0; - memset(&ecmd, 0x00, sizeof(struct ethtool_cmd)); + zero(ecmd); ecmd.cmd = ETHTOOL_GSET; - memset(&ifr, 0x00, sizeof(struct ifreq)); + + zero(ifr); strscpy(ifr.ifr_name, IFNAMSIZ, ifname); ifr.ifr_data = (void *)&ecmd; @@ -125,9 +126,10 @@ int ethtool_set_wol(int fd, const char *ifname, WakeOnLan wol) { if (wol == _WOL_INVALID) return 0; - memset(&ecmd, 0x00, sizeof(struct ethtool_wolinfo)); + zero(ecmd); ecmd.cmd = ETHTOOL_GWOL; - memset(&ifr, 0x00, sizeof(struct ifreq)); + + zero(ifr); strscpy(ifr.ifr_name, IFNAMSIZ, ifname); ifr.ifr_data = (void *)&ecmd;