Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511AbbHOURD (ORCPT ); Sat, 15 Aug 2015 16:17:03 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:54036 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753639AbbHOURA (ORCPT ); Sat, 15 Aug 2015 16:17: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:16:03 +0200 Message-ID: <1871097.B3YgX5rNy0@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1439289789-29026-1-git-send-email-leilk.liu@mediatek.com> References: <1439289789-29026-1-git-send-email-leilk.liu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:A5hqNNEaOBWqjy3mbDv3CJroyG6jP1/MajOJlko3a2QAYGqWFC+ blZRo4BGON4OxuKwsBgGcxObbGviGaa6ayRqlyf+b+JYxO7xrbn9MlxMRVztM13hhIu3mUG 3q+R6E/ZMEQOeR5f+DqG/eolZWs+nJJHdLVnkU8WzD5sS5V7N2pIKVYQRaPWg07tjp+abX7 +uH9BLJ1czX/6nLcOFjwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:vXmYCcKA0Io=:s4HZQ6aXJ+drRcnGx44PNW bkE7BXLP/OOpGb+vlT2oW2FNb55igw/TZOc9Xk/h6CYfrMow5TUbHxgOw+CInGDP+BJy3/O2T 0FUUa2zv2Uk6vUIgeAmjdUipU1zP0DMJ4tbsA/XUWxI8gd04kparvn/1SkNIPOpQvCA1yS918 R0v6KozSXfu3a0OTf0KtWg6idxNmBkipxZR24j51E2bRLa29eVXJ561zD9+FLHAFPHc8f6B2X zGaRoDjio99EI9JmEefgVkEM4EEOXHdkVk0j6RbHNZ6cwUL+erSBUYMR7I73jwKk6dfv1mp05 J4/qIn7kOfB+wjb/Y8QAIniC4GQjWXRcWeHYD773wlHnSE0pBf68UpxDCxSZpv0WpNXRcrQUD 1WIRVqBc07sObBuDsdqdL0TfgTEr7e6y8sKrZADxeK+I9843mVs6EoZndVkdh0rJBUqswC+Or jSngILKiLpXdqen2jhY+izprB51Fg0JQgQFZ9VomZHConOdAoWuWxGYav81xMvQBrYBihC3/X DgE3sz3F1WqGgl9M8aJYiUiE1o+ysBE1BtR5Tn2f9wSJm3xkD5Uv8CRSeZqzrH1CQJcl61ydR Hr5EWn1sL5SsWYs0zaWgvAvJafb6PW9PK5D21psycNO1dSuB/KKckb0B85om2VVvBydapFqV0 TzDV7UGEnIH8Ah4IsTdkUBwR4co5vpcDIALPMarG1UDcL98egqXCgVKLjWXfPVFeKEPum9m3v sgWBlKKa2M5YTBwF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 28 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. 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/