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: 110833 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4138620qge; Wed, 23 Aug 2017 06:35:19 -0700 (PDT) X-Received: by 10.84.174.131 with SMTP id r3mr3119587plb.37.1503495319177; Wed, 23 Aug 2017 06:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503495319; cv=none; d=google.com; s=arc-20160816; b=TvKpCxPcHcC4EoCbDgTRSvdQzMRl2SZizVgCPm0qM2b1kpHi71W3+MFD3OCAV69mBj zmToRuT7jkSomLkKaxg0NO6YwF9UBLEQKQ52/nxqItWYdEkj76GD5533CbJnFm70HjBL gZmKunN6L++zjgzw5XhgphnQSiYochZtrDcLbtme8uQLVQ9tRmAfVAmZg7oeHydlgSKx bTykXDxXejV+aj+DBDME2qCi0fwNHvAk9t3niqoeipVMWGfUzDQvf1nKXxAEdjtAzVcx EC1qX9+0WOsbBBiiz8nVnwvPmwM7UaiIJvkeAIPtmRWuu0IRSSgWL9vq4oUvTNw8NkQA TGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9mpPPKfyxXVoti16vp14Tbc63Pv5ZwHJOgiIUuTzi+U=; b=MZyHeJPYS0HY71wGHvEhanKSZtb+cayQJeE7WVDAI6Vt73yH42OnAGKQvVyOmMC4ge z0Sz44EhRqps8VMEjmxfICyOLbZZobPieaMYuF0dq+/5bO71zjxqtUOf6QV9FzW2bp1y st4NWlZhU2UD7lvtJusUH08wbCjW6XV4maB/VxK4qlLuG1BSjGnp9egVf62YqVupEP6Q LSd1oxrcMsQqZNDlObPp/y2L6XvotNWPW0CljmwoievMy9CmmiNKzO/Hzk9NSdm9wcSx YL+WzMya1qNnc2zhLZg7e9tPC4L3+cXr3L8Rk+BUxAImpQIauCmxDrDHIErYn1K+STLg 9f+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si1110068pfm.174.2017.08.23.06.35.19 for ; Wed, 23 Aug 2017 06:35:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org 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 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(+) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;