From: Michal Kubecek <mkubecek@suse.cz>
To: Li RongQing <lirongqing@baidu.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] ethtool: Use explicit designated initializers for .cmd
Date: Wed, 27 Feb 2019 14:51:59 +0100 [thread overview]
Message-ID: <20190227135159.GC29992@unicorn.suse.cz> (raw)
In-Reply-To: <1551271677-14492-1-git-send-email-lirongqing@baidu.com>
On Wed, Feb 27, 2019 at 08:47:57PM +0800, Li RongQing wrote:
> 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>
> ---
> net/core/ethtool.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 47558ffae423..d4918ffddda8 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -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;
> @@ -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)
> --
> 2.16.2
>
next prev parent reply other threads:[~2019-02-27 13:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 12:47 [PATCH][net-next] ethtool: Use explicit designated initializers for .cmd Li RongQing
2019-02-27 13:51 ` Michal Kubecek [this message]
2019-02-27 18:08 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190227135159.GC29992@unicorn.suse.cz \
--to=mkubecek@suse.cz \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.