[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <925845a7-c79b-a434-ca1c-bc9b660aa3ba@denx.de>
Date: Sat, 15 Feb 2020 10:47:56 +0100
From: Marek Vasut <marex@...x.de>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, lukas@...ner.de, ynezz@...e.cz,
yuehaibing@...wei.com
Subject: Re: [PATCH 2/3] net: ks8851-ml: Fix 16-bit data access
On 2/15/20 10:24 AM, David Miller wrote:
> From: Marek Vasut <marex@...x.de>
> Date: Mon, 10 Feb 2020 19:41:38 +0100
>
>> @@ -197,7 +197,7 @@ static inline void ks_inblk(struct ks_net *ks, u16 *wptr, u32 len)
>> {
>> len >>= 1;
>> while (len--)
>> - *wptr++ = (u16)ioread16(ks->hw_addr);
>> + *wptr++ = swab16(ioread16(ks->hw_addr));
>
> I agree with the other feedback, the endianness looks wrong here.
>
> The ioread16() translates whatever is behind ks->hw_addr into cpu
> endianness.
>
> This is either always little endian (for example), which means that
> unconditionally swapping this doesn't seem to make sense.
So what is the suggestion to fix this properly ?
Powered by blists - more mailing lists