From patchwork Wed Aug 23 13:34:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9917383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D1CB8603FA for ; Wed, 23 Aug 2017 13:35:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C18172874A for ; Wed, 23 Aug 2017 13:35:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B500628943; Wed, 23 Aug 2017 13:35:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11FC22874A for ; Wed, 23 Aug 2017 13:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbdHWNfS (ORCPT ); Wed, 23 Aug 2017 09:35:18 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:58645 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996AbdHWNfR (ORCPT ); Wed, 23 Aug 2017 09:35:17 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0McMsh-1e1M0H0dZn-00JXVb; Wed, 23 Aug 2017 15:35:02 +0200 From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Sascha Hauer , jiada wang , Martin Kaiser , Marek Vasut , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: imx: fix little-endian build Date: Wed, 23 Aug 2017 15:34:43 +0200 Message-Id: <20170823133452.796321-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:7/P9CXhvF8UksZqtLB50FIjQXQt4/bCyDie5WLLrqQ40RaToe2w qcG63eCk9NdHqab506uYSwxa/vgkKvssSO5+srQZy6AmK06nQFT+F6Prjrt1Ec08Fv/P9iU Dq4ACFE2WY5QU0hQiQjoAURJzENKWnkFJhUrbpkkUFEM2YXhEW3zcBR45gf/i6o3MhvwO3C W15jUXG88rOfj3eKnyaWQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:O+z8+EVe+aY=:id3wlnnVF3XWUBvvPNc42G xej2yIlXD7OD8JmrlfUqLyXSYSJ8OO8TW/vt96ZJ/huPc8pqQWgSODNFbt1eausUqn5s8yDF8 e0iT+T3yDF05potuFKht97rKuCEVUqZRdT4AmGHccJMsMef7thfOAwXe6nBSYYG02EAxVcZWp M0Pv2TkkxOtzlR+OeC07hhQZmQaLkqVj7/UKE9PVY18WssK2W2Ae9ojZBUEKKNUo2axoTotQw FswYQqy/prOcKBJvRMg+tDqUtBugneY/+Ukj06EYYgYY2euqNfKWhuYnnZ/MUJmTzbriblVUg jZ3EapirojB08H0TgXxb5ceIVotlNki4MHOBhFaSVFn5+OM1mEOHPlejwyZ1DxazeIJDdzivj UdRtugbUFoDj1ZT44dSgGPnuJwchSh3u8qNQYK9YXUvnCDYx3Xw1eBTfiAApBTAUsW2VpWysT dkGYq0ZvPPE0loCsjv0K6zi38KhRECJ7WuuhPXxFY+TnTJl++79MTy8LVYX2mEgH1TQYn1zhb 6Odnabct8uP2BjeERnxfOt5DkxAtgCodVq91xIqrEQzXwIDEwkycuWlNO4MvEUMw8iwn9ykyQ zeBzh/cYYDtqmf9+PcWxq3yN+qGKmxR1AVY/qF26LrHjXdP/6LjbFBjaRWLsf5gEO6cZ+Rok+ LhMYNjgeO9IIMgcrFq2CEryVpXe+Nd6KaZrBx8NkRPR5JUsqECbQ2x+OpFXSrkYnygtq0NgAd RYiv5ACu5cCFcInNTR6k/FvN1GQ8QwqChI3PJA== Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added dynamic burst code produces a harmless warning on big-endian configurations: drivers/spi/spi-imx.c: In function 'spi_imx_buf_rx_swap_u32': drivers/spi/spi-imx.c:284:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable] unsigned int bytes_per_word; ^~~~~~~~~~~~~~ drivers/spi/spi-imx.c: In function 'spi_imx_buf_tx_swap_u32': drivers/spi/spi-imx.c:319:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable] unsigned int bytes_per_word; This adds another #ifdef around the variable declaration matching the one on the use. Fixes: 1673c81d9435 ("spi: imx: dynamic burst length adjust for PIO mode") Signed-off-by: Arnd Bergmann --- drivers/spi/spi-imx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index cc808a1c765c..6fcb6adf9565 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -281,7 +281,9 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, static void spi_imx_buf_rx_swap_u32(struct spi_imx_data *spi_imx) { unsigned int val = readl(spi_imx->base + MXC_CSPIRXDATA); +#ifdef __LITTLE_ENDIAN unsigned int bytes_per_word; +#endif if (spi_imx->rx_buf) { #ifdef __LITTLE_ENDIAN @@ -316,7 +318,9 @@ static void spi_imx_buf_rx_swap(struct spi_imx_data *spi_imx) static void spi_imx_buf_tx_swap_u32(struct spi_imx_data *spi_imx) { u32 val = 0; +#ifdef __LITTLE_ENDIAN unsigned int bytes_per_word; +#endif if (spi_imx->tx_buf) { val = *(u32 *)spi_imx->tx_buf;