[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <694dacbe-f9a1-41ee-8131-d931dbd91b10@aquantia.com>
Date: Tue, 14 May 2019 12:37:52 +0000
From: Igor Russkikh <Igor.Russkikh@...antia.com>
To: Oliver Neukum <oneukum@...e.com>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/3] aqc111: fix endianness issue in aqc111_change_mtu
On 09.05.2019 12:08, Oliver Neukum wrote:
> If the MTU is large enough, the first write to the device
> is just repeated. On BE architectures, however, the first
> word of the command will be swapped a second time and garbage
> will be written. Avoid that.
>
> Signed-off-by: Oliver Neukum <oneukum@...e.com>
> ---
> drivers/net/usb/aqc111.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
> index aff995be2a31..408df2d335e3 100644
> --- a/drivers/net/usb/aqc111.c
> +++ b/drivers/net/usb/aqc111.c
> @@ -453,6 +453,8 @@ static int aqc111_change_mtu(struct net_device *net, int new_mtu)
> reg16 = 0x1420;
> else if (dev->net->mtu <= 16334)
> reg16 = 0x1A20;
> + else
> + return 0;
>
> aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_PAUSE_WATERLVL_LOW,
> 2, ®16);
>
Since we specify max_mtu at `bind` time, this `else` will never happen.
Only for readability that could be rewritten as
- else if (dev->net->mtu <= 16334)
+ else
reg16 = 0x1A20;
Regards,
Igor
Powered by blists - more mailing lists