Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754575AbbHOUSD (ORCPT ); Sat, 15 Aug 2015 16:18:03 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52807 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754535AbbHOUSA (ORCPT ); Sat, 15 Aug 2015 16:18:00 -0400 From: Arnd Bergmann To: Leilk Liu Cc: Mark Brown , Mark Rutland , Matthias Brugger , Sascha Hauer , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] spi: Mediatek: fix endian warnings Date: Sat, 15 Aug 2015 22:17:15 +0200 Message-ID: <4559739.Ziakvog9nM@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1871097.B3YgX5rNy0@wuerfel> References: <1439289789-29026-1-git-send-email-leilk.liu@mediatek.com> <1871097.B3YgX5rNy0@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:hQ0SlZ7mt+9gzxXh5g7H4jppx8nVaiXXi3z8ubSpoDKVQHA6OhT ELqAy/9UV19UOlxOkwZRqS9NU4ioGY+v4GL2F32DmKPvHZJ9IaSQhSbZVW3OpIeqdQK7neb Xabq5NFTKfnpC+DUb8SBvH0O8tGz7syjpQOn7RNVsA/pAZHuec+KOq4+ALx/SyyoszDtWUe X0k5ghhWXAcC0vMquYxyQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ELmhId/337s=:yHnM4Y7I9nFO6L/dXXdbpX WaL2ux8XoJVeT66IKTz9pZXs9iypsuos292Q7EWKPdsSe+3c3vuJFSQXuqesFBWCYd0Z3rUXt zu7lpws4J7d62COxWjwhUChpP1bqzmB5tOPvasPwc6m2kknohPYSpb8NDhuB4oqbo8QSrS2nR vXr/xlCW9+VjJyNSeQ5zOtlHwuNIl+m9PDuRQ1H/TYSGJQXjNYAM1ZY5TyOVpMZZ+eNIaT+60 auvuu0gHRk9paY8Li0JqrVDpKapPDLfAr7P4rwVWImKirg9xVk8gJ1BMCxuqwGuR3Y0k5e914 4dxzQp0MZqyno4nT7vHIwU7+RZ1pnd6a1yG4PYm7QxJmLDUAHut4tses4yKYZm+/FVhe3f8dh N8vD+rkEMce8pR5yQAX0PzegkAgUpgQXNIFL5hmnboel9BUcgmY0QXDaAHPVSIOTLh3HVrznE uPC+GB0XiYb2Tv+rBLu+fUzEFUqbvFUKyXNAZ/rKvHYkkHeRw/EWpJTtq9W7ZJnkPQyZIPfVT u9w3a3XujI7FHFDtJOR2kZ/3KD3OX5oJ+kZMgnAwjMIJr/DgmSMmg+Q6/ElbIPcWKls0i37ew adm07nxA3UX0nPwwEF8468I+/3E6andU8ghDSMqkEhDCJuDos8M6srFjGR1W/0EwZtjCALHSP bNsgXxIrJb38617F9tBs9URv4/suXpCkLvh50HlDB2iz6WhiW1Gl8o+/IUvt6y6pf8yCCGHBr BLqZnHREdn0d5SIc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1369 Lines: 31 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/