Skip to content

Commit

Permalink
ethtool: Use explicit designated initializers for .cmd
Browse files Browse the repository at this point in the history
Initialize the .cmd member by using a designated struct
initializer. This fixes warning of missing field initializers,
and makes code a little easier to read.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Feb 27, 2019
1 parent ff8285f commit e83887f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,

static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr)
{
struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
struct ethtool_pauseparam pauseparam = { .cmd = ETHTOOL_GPAUSEPARAM };

if (!dev->ethtool_ops->get_pauseparam)
return -EOPNOTSUPP;
Expand Down Expand Up @@ -2503,7 +2503,7 @@ static int set_phy_tunable(struct net_device *dev, void __user *useraddr)

static int ethtool_get_fecparam(struct net_device *dev, void __user *useraddr)
{
struct ethtool_fecparam fecparam = { ETHTOOL_GFECPARAM };
struct ethtool_fecparam fecparam = { .cmd = ETHTOOL_GFECPARAM };
int rc;

if (!dev->ethtool_ops->get_fecparam)
Expand Down

0 comments on commit e83887f

Please sign in to comment.