From patchwork Tue Sep 2 02:52:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 4822651 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D90A9F2ED for ; Tue, 2 Sep 2014 02:52:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 269B620172 for ; Tue, 2 Sep 2014 02:52:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B47720160 for ; Tue, 2 Sep 2014 02:52:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbaIBCw0 (ORCPT ); Mon, 1 Sep 2014 22:52:26 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:53569 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbaIBCwZ (ORCPT ); Mon, 1 Sep 2014 22:52:25 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NB900BT06NCOS30@mailout3.samsung.com> for linux-spi@vger.kernel.org; Tue, 02 Sep 2014 11:52:24 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.47]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 82.21.02948.8E035045; Tue, 02 Sep 2014 11:52:24 +0900 (KST) X-AuditID: cbfee68d-f79c46d000000b84-b8-540530e82df5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BE.CA.05196.7E035045; Tue, 02 Sep 2014 11:52:23 +0900 (KST) Received: from DOJG1HAN03 ([12.36.165.116]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NB900CWH6NB9GC0@mmp2.samsung.com>; Tue, 02 Sep 2014 11:52:23 +0900 (KST) From: Jingoo Han To: 'Mark Brown' Cc: linux-spi@vger.kernel.org, 'Laxman Dewangan' , 'Jingoo Han' References: <002101cfc658$4f627cf0$ee2776d0$%han@samsung.com> In-reply-to: <002101cfc658$4f627cf0$ee2776d0$%han@samsung.com> Subject: [PATCH 6/9] spi: tegra114: Fix checkpatch issue Date: Tue, 02 Sep 2014 11:52:23 +0900 Message-id: <002601cfc658$ec0efa60$c42cef20$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac/GWEr6KtXvbZQZQNOh58P4064PRQAAIgAg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRmVeSWpSXmKPExsVy+t8zfd0XBqwhBktvMltMffiEzeLywkus Fkv3rWaxaPx4k92BxWPTqk42j97md2wefVtWMXp83iQXwBLFZZOSmpNZllqkb5fAlTHp5CWm gitiFSvWzGFuYLwh2MXIySEhYCKx6cx6VghbTOLCvfVsXYxcHEICyxglzj9uYoIperp7KVRi OqPE2tv3WSGc34wSZ3Z9YAepYhNQk/jy5TCQzcEhIqAq8f+VO0iYWSBXYv/uDiaQsJCArcSu phqQMKeAnUT3pC6wamEBC4mu9c4gYRagxmVrjzGC2LxA1XOuHGSFsAUlfky+xwIxUUti/c7j TBC2vMTmNW+ZQcZICKhLPPqrCxIWETCSaN3eC1UuIrHvxTtGiE+OsUucadaAWCUg8W3yIRaI VlmJTQeYIUokJQ6uuMEygVFiFpLFs5AsnoVk8SwkGxYwsqxiFE0tSC4oTkovMtQrTswtLs1L 10vOz93ECIn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32gb2k/Gy1j4yF5u8PX5tx+ccmZo3IEwaPdpqHak5mYIq6nzNPuer3/2PappVt W3RWbli15uOd9T0ykXv+f1r2NqVYWXqh7LL7BR35fqVsv+ZarJe46j7dR74uor/oXsAy0Ys3 JjNFri13k1/xhf/kVCWW4oxEQy3mouJEALYQ4K0NAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following checkpatch warnings. WARNING: Missing a blank line after declarations Signed-off-by: Jingoo Han --- drivers/spi/spi-tegra114.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index e4a85ada861d..795bcbc0131b 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -302,6 +302,7 @@ static unsigned tegra_spi_fill_tx_fifo_from_client_txbuf( max_n_32bit = DIV_ROUND_UP(nbytes, 4); for (count = 0; count < max_n_32bit; count++) { u32 x = 0; + for (i = 0; (i < 4) && nbytes; i++, nbytes--) x |= (u32)(*tx_buf++) << (i * 8); tegra_spi_writel(tspi, x, SPI_TX_FIFO); @@ -312,6 +313,7 @@ static unsigned tegra_spi_fill_tx_fifo_from_client_txbuf( nbytes = written_words * tspi->bytes_per_word; for (count = 0; count < max_n_32bit; count++) { u32 x = 0; + for (i = 0; nbytes && (i < tspi->bytes_per_word); i++, nbytes--) x |= (u32)(*tx_buf++) << (i * 8); @@ -338,6 +340,7 @@ static unsigned int tegra_spi_read_rx_fifo_to_client_rxbuf( len = tspi->curr_dma_words * tspi->bytes_per_word; for (count = 0; count < rx_full_count; count++) { u32 x = tegra_spi_readl(tspi, SPI_RX_FIFO); + for (i = 0; len && (i < 4); i++, len--) *rx_buf++ = (x >> i*8) & 0xFF; } @@ -345,8 +348,10 @@ static unsigned int tegra_spi_read_rx_fifo_to_client_rxbuf( read_words += tspi->curr_dma_words; } else { u32 rx_mask = ((u32)1 << t->bits_per_word) - 1; + for (count = 0; count < rx_full_count; count++) { u32 x = tegra_spi_readl(tspi, SPI_RX_FIFO) & rx_mask; + for (i = 0; (i < tspi->bytes_per_word); i++) *rx_buf++ = (x >> (i*8)) & 0xFF; } @@ -365,6 +370,7 @@ static void tegra_spi_copy_client_txbuf_to_spi_txbuf( if (tspi->is_packed) { unsigned len = tspi->curr_dma_words * tspi->bytes_per_word; + memcpy(tspi->tx_dma_buf, t->tx_buf + tspi->cur_pos, len); } else { unsigned int i; @@ -374,6 +380,7 @@ static void tegra_spi_copy_client_txbuf_to_spi_txbuf( for (count = 0; count < tspi->curr_dma_words; count++) { u32 x = 0; + for (i = 0; consume && (i < tspi->bytes_per_word); i++, consume--) x |= (u32)(*tx_buf++) << (i * 8); @@ -396,6 +403,7 @@ static void tegra_spi_copy_spi_rxbuf_to_client_rxbuf( if (tspi->is_packed) { unsigned len = tspi->curr_dma_words * tspi->bytes_per_word; + memcpy(t->rx_buf + tspi->cur_rx_pos, tspi->rx_dma_buf, len); } else { unsigned int i; @@ -405,6 +413,7 @@ static void tegra_spi_copy_spi_rxbuf_to_client_rxbuf( for (count = 0; count < tspi->curr_dma_words; count++) { u32 x = tspi->rx_dma_buf[count] & rx_mask; + for (i = 0; (i < tspi->bytes_per_word); i++) *rx_buf++ = (x >> (i*8)) & 0xFF; }