diff options
| author | Roland Dreier <rolandd@cisco.com> | 2010-02-11 15:14:23 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-02-11 15:14:23 -0500 |
| commit | 8e5574211d96c0552f84c757718475fdb4021be7 (patch) | |
| tree | c2b9201e104fbc8a2b714cba32ca175c5db73926 | |
| parent | 92eb879ff59c5995bf18f76eb0a00cb7db758e42 (diff) | |
ethtool: Use explicit designated initializers for .cmd
Initialize the .cmd member of various ethtool using a designated struct
initializer rather. This makes things a teeny bit more robust, although
the chance of a struct layout changing is extremely remote, and also
makes the code a little easier to read.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/core/ethtool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 6ec73d3983a3..a1280f643bf4 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
| @@ -163,7 +163,7 @@ EXPORT_SYMBOL(ethtool_ntuple_flush); | |||
| 163 | 163 | ||
| 164 | static int ethtool_get_settings(struct net_device *dev, void __user *useraddr) | 164 | static int ethtool_get_settings(struct net_device *dev, void __user *useraddr) |
| 165 | { | 165 | { |
| 166 | struct ethtool_cmd cmd = { ETHTOOL_GSET }; | 166 | struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET }; |
| 167 | int err; | 167 | int err; |
| 168 | 168 | ||
| 169 | if (!dev->ethtool_ops->get_settings) | 169 | if (!dev->ethtool_ops->get_settings) |
| @@ -645,7 +645,7 @@ static int ethtool_reset(struct net_device *dev, char __user *useraddr) | |||
| 645 | 645 | ||
| 646 | static int ethtool_get_wol(struct net_device *dev, char __user *useraddr) | 646 | static int ethtool_get_wol(struct net_device *dev, char __user *useraddr) |
| 647 | { | 647 | { |
| 648 | struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; | 648 | struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; |
| 649 | 649 | ||
| 650 | if (!dev->ethtool_ops->get_wol) | 650 | if (!dev->ethtool_ops->get_wol) |
| 651 | return -EOPNOTSUPP; | 651 | return -EOPNOTSUPP; |
| @@ -779,7 +779,7 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) | |||
| 779 | 779 | ||
| 780 | static int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) | 780 | static int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) |
| 781 | { | 781 | { |
| 782 | struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE }; | 782 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; |
| 783 | 783 | ||
| 784 | if (!dev->ethtool_ops->get_coalesce) | 784 | if (!dev->ethtool_ops->get_coalesce) |
| 785 | return -EOPNOTSUPP; | 785 | return -EOPNOTSUPP; |
| @@ -806,7 +806,7 @@ static int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) | |||
| 806 | 806 | ||
| 807 | static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr) | 807 | static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr) |
| 808 | { | 808 | { |
| 809 | struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM }; | 809 | struct ethtool_ringparam ringparam = { .cmd = ETHTOOL_GRINGPARAM }; |
| 810 | 810 | ||
| 811 | if (!dev->ethtool_ops->get_ringparam) | 811 | if (!dev->ethtool_ops->get_ringparam) |
| 812 | return -EOPNOTSUPP; | 812 | return -EOPNOTSUPP; |
| @@ -1160,7 +1160,7 @@ static int ethtool_get_perm_addr(struct net_device *dev, void __user *useraddr) | |||
| 1160 | static int ethtool_get_value(struct net_device *dev, char __user *useraddr, | 1160 | static int ethtool_get_value(struct net_device *dev, char __user *useraddr, |
| 1161 | u32 cmd, u32 (*actor)(struct net_device *)) | 1161 | u32 cmd, u32 (*actor)(struct net_device *)) |
| 1162 | { | 1162 | { |
| 1163 | struct ethtool_value edata = { cmd }; | 1163 | struct ethtool_value edata = { .cmd = cmd }; |
| 1164 | 1164 | ||
| 1165 | if (!actor) | 1165 | if (!actor) |
| 1166 | return -EOPNOTSUPP; | 1166 | return -EOPNOTSUPP; |
