netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: marex@denx.de
Cc: netdev@vger.kernel.org, lukas@wunner.de, ynezz@true.cz,
	yuehaibing@huawei.com
Subject: Re: [PATCH 2/3] net: ks8851-ml: Fix 16-bit data access
Date: Sat, 15 Feb 2020 01:24:58 -0800 (PST)	[thread overview]
Message-ID: <20200215.012458.724817187941650024.davem@davemloft.net> (raw)
In-Reply-To: <20200210184139.342716-2-marex@denx.de>

From: Marek Vasut <marex@denx.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.

  parent reply	other threads:[~2020-02-15  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 18:41 [PATCH 1/3] net: ks8851-ml: Remove 8-bit bus accessors Marek Vasut
2020-02-10 18:41 ` [PATCH 2/3] net: ks8851-ml: Fix 16-bit data access Marek Vasut
2020-02-10 19:35   ` Lukas Wunner
2020-02-10 19:40     ` Marek Vasut
2020-02-15  9:24   ` David Miller [this message]
2020-02-15  9:47     ` Marek Vasut
2020-02-15  9:56       ` David Miller
2020-02-10 18:41 ` [PATCH 3/3] net: ks8851-ml: Fix 16-bit IO operation Marek Vasut
2020-02-10 19:31 ` [PATCH 1/3] net: ks8851-ml: Remove 8-bit bus accessors Lukas Wunner
2020-02-10 19:44   ` Marek Vasut

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=20200215.012458.724817187941650024.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=lukas@wunner.de \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=ynezz@true.cz \
    --cc=yuehaibing@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).