Skip to content

Commit e83887f

Browse files
lrq-maxdavem330
authored andcommitted
ethtool: Use explicit designated initializers for .cmd
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>
1 parent ff8285f commit e83887f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/core/ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
17171717

17181718
static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr)
17191719
{
1720-
struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
1720+
struct ethtool_pauseparam pauseparam = { .cmd = ETHTOOL_GPAUSEPARAM };
17211721

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

25042504
static int ethtool_get_fecparam(struct net_device *dev, void __user *useraddr)
25052505
{
2506-
struct ethtool_fecparam fecparam = { ETHTOOL_GFECPARAM };
2506+
struct ethtool_fecparam fecparam = { .cmd = ETHTOOL_GFECPARAM };
25072507
int rc;
25082508

25092509
if (!dev->ethtool_ops->get_fecparam)

0 commit comments

Comments
 (0)