[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5241cecb-206e-4999-b495-a6584790905d@gmx.de>
Date: Wed, 15 Feb 2017 21:56:30 +0100
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Pavel Belous <Pavel.Belous@...antia.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org,
Simon Edelhaus <Simon.Edelhaus@...antia.com>,
Alexey Andriyanov <Alexey.Andriyanov@...antia.com>
Subject: Re: [PATCH net-next 03/13] net: ethernet: aquantia: Removed
unnecessary comparsion "old_mtu == new_mtu".
On 15.02.2017 21:01, Pavel Belous wrote:
> From: Pavel Belous <pavel.belous@...antia.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@...antia.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;
> }
> +
> err = aq_nic_set_mtu(aq_nic, new_mtu + ETH_HLEN);
> if (err < 0)
> goto err_exit;
> +
> ndev->mtu = new_mtu;
>
> if (netif_running(ndev)) {
>
Reviewed-by: Lino Sanfilippo <LinoSanfilippo@....de>
Regards,
Lino
Powered by blists - more mailing lists