From: Andrew Lunn <andrew@lunn•ch>
To: Pavel Belous <Pavel.Belous@aquantia•com>
Cc: "David S . Miller" <davem@davemloft•net>,
netdev@vger•kernel.org,
Simon Edelhaus <Simon.Edelhaus@aquantia•com>,
Alexey Andriyanov <Alexey.Andriyanov@aquantia•com>,
Lino Sanfilippo <LinoSanfilippo@gmx•de>
Subject: Re: [PATCH net-next v2 03/12] net: ethernet: aquantia: Removed unnecessary comparsion "old_mtu == new_mtu".
Date: Fri, 17 Feb 2017 23:41:57 +0100 [thread overview]
Message-ID: <20170217224157.GO6096@lunn.ch> (raw)
In-Reply-To: <6b965301a08041d2a8d8537a25e8a0642fa6d669.1487365317.git.pavel.belous@aquantia.com>
On Sat, Feb 18, 2017 at 12:07:25AM +0300, Pavel Belous wrote:
> From: Pavel Belous <pavel.belous@aquantia•com>
>
> This check is not needed. Function aq_ndev_change_mtu wont be called
> if mtu has not changed.
>
> Signed-off-by: Pavel Belous <pavel.belous@aquantia•com>
> ---
> drivers/net/ethernet/aquantia/atlantic/aq_main.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> index c17c70a..e5539c8 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> @@ -102,17 +102,15 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
> struct aq_nic_s *aq_nic = netdev_priv(ndev);
> int err = 0;
>
> - if (new_mtu == ndev->mtu) {
> - err = 0;
> - goto err_exit;
> - }
> if (new_mtu < 68) {
> err = -EINVAL;
> goto err_exit;
> }
You can set ndev->min_mtu and the core will do this check for you.
> +
> err = aq_nic_set_mtu(aq_nic, new_mtu + ETH_HLEN);
> if (err < 0)
> goto err_exit;
> +
White space changes should be in a separate patch.
> ndev->mtu = new_mtu;
I think __dev_set_mtu() takes care of this for you.
Andrew
next prev parent reply other threads:[~2017-02-17 22:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 21:07 [PATCH net-next v2 00/12] net: ethernet: aquantia: improvements and fixes Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 01/12] net: ethernet: aquantia: Removed extra assignment for skb->dev Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 02/12] net: ethernet: aquantia: Removed busy_count field Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 03/12] net: ethernet: aquantia: Removed unnecessary comparsion "old_mtu == new_mtu" Pavel Belous
2017-02-17 22:41 ` Andrew Lunn [this message]
2017-02-17 21:07 ` [PATCH net-next v2 04/12] net: ethernet: aquantia: Using module_pci_driver Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 05/12] net: ethernet: aquantia: Superfluous initialization of "err" Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 06/12] net: ethernet: aquantia: Fixed missing rtnl_unlock Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 07/12] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0 Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 08/12] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 09/12] net: ethernet: aquantia: Call netdev_register after all initialized Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 10/12] net: ethernet: aquantia: Fixed incorrect buff->len calculation Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page Pavel Belous
2017-02-17 22:43 ` Andrew Lunn
2017-02-18 16:33 ` Pavel Belous
2017-02-18 11:50 ` Lino Sanfilippo
2017-02-18 16:44 ` Pavel Belous
2017-02-17 21:07 ` [PATCH net-next v2 12/12] net: ethernet: aquantia: Copying tx buffers is not needed Pavel Belous
2017-02-18 11:56 ` [PATCH net-next v2 00/12] net: ethernet: aquantia: improvements and fixes Lino Sanfilippo
2017-02-18 16:42 ` Pavel Belous
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=20170217224157.GO6096@lunn.ch \
--to=andrew@lunn$(echo .)ch \
--cc=Alexey.Andriyanov@aquantia$(echo .)com \
--cc=LinoSanfilippo@gmx$(echo .)de \
--cc=Pavel.Belous@aquantia$(echo .)com \
--cc=Simon.Edelhaus@aquantia$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox