From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] spi: Mediatek: fix endian warnings
Date: Sat, 15 Aug 2015 22:17:15 +0200 [thread overview]
Message-ID: <4559739.Ziakvog9nM@wuerfel> (raw)
In-Reply-To: <1871097.B3YgX5rNy0@wuerfel>
On Saturday 15 August 2015 22:16:03 Arnd Bergmann wrote:
> On Tuesday 11 August 2015 18:43:09 Leilk Liu wrote:
> > @@ -359,9 +359,11 @@ static void mtk_spi_setup_dma_addr(struct spi_master *master,
> > struct mtk_spi *mdata = spi_master_get_devdata(master);
> >
> > if (mdata->tx_sgl)
> > - writel(cpu_to_le32(xfer->tx_dma), mdata->base + SPI_TX_SRC_REG);
> > + writel((__force u32)cpu_to_le32(xfer->tx_dma),
> > + mdata->base + SPI_TX_SRC_REG);
> > if (mdata->rx_sgl)
> > - writel(cpu_to_le32(xfer->rx_dma), mdata->base + SPI_RX_DST_REG);
> > + writel((__force u32)cpu_to_le32(xfer->rx_dma),
> > + mdata->base + SPI_RX_DST_REG);
> > }
> >
>
> This looks wrong: writel takes a CPU-endian argument, so the value returned
> from cpu_to_le32() is not appropriate.
>
> The warning is correct, and you have to remove the cpu_to_le32() conversion
> in order to get the driver to behave correctly when the kernel is built
> as big-endian.
Nevermind, I now saw the issue has already been raised.
Arnd
next prev parent reply other threads:[~2015-08-15 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 10:43 [PATCH] spi: Mediatek: fix endian warnings Leilk Liu
2015-08-12 14:45 ` Jonas Gorski
2015-08-13 2:11 ` lei liu
2015-08-13 9:19 ` Mark Brown
2015-08-15 20:16 ` Arnd Bergmann
2015-08-15 20:17 ` Arnd Bergmann [this message]
2015-08-16 14:06 ` Russell King - ARM Linux
2015-08-17 3:30 ` Mark Brown
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=4559739.Ziakvog9nM@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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