From patchwork Tue Sep 2 02:49:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 4822611 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DDFB9C0338 for ; Tue, 2 Sep 2014 02:49:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19E8820155 for ; Tue, 2 Sep 2014 02:49:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26BB320172 for ; Tue, 2 Sep 2014 02:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbaIBCt1 (ORCPT ); Mon, 1 Sep 2014 22:49:27 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:52929 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbaIBCt1 (ORCPT ); Mon, 1 Sep 2014 22:49:27 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NB900BHR6ICOS30@mailout3.samsung.com> for linux-spi@vger.kernel.org; Tue, 02 Sep 2014 11:49:25 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 8F.CC.04442.43035045; Tue, 02 Sep 2014 11:49:24 +0900 (KST) X-AuditID: cbfee690-f79ce6d00000115a-c6-54053034312b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 52.3A.05196.43035045; Tue, 02 Sep 2014 11:49:24 +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 <0NB900E5N6ICJC90@mmp2.samsung.com>; Tue, 02 Sep 2014 11:49:24 +0900 (KST) From: Jingoo Han To: 'Mark Brown' Cc: linux-spi@vger.kernel.org, 'Baruch Siach' , 'Jingoo Han' References: <002101cfc658$4f627cf0$ee2776d0$%han@samsung.com> In-reply-to: <002101cfc658$4f627cf0$ee2776d0$%han@samsung.com> Subject: [PATCH 2/9] spi: dw: Fix checkpatch issue Date: Tue, 02 Sep 2014 11:49:24 +0900 Message-id: <002201cfc658$816252c0$8426f840$%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/GWEr6KtXvbZQZQNOh58P4064PRQAABsVg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRmVeSWpSXmKPExsVy+t8zY10TA9YQgx+7LC1WXHvDYjH14RM2 i8sLL7FaNH68ye7A4rFpVSebR9+WVYwecxtuMXl83iQXwBLFZZOSmpNZllqkb5fAlXH1wzzG gu9CFf9nfGZvYJzD38XIwSEhYCJx5QqQyQlkiklcuLeerYuRi0NIYBmjxNvmO4wwNf92mkHE pzNKvP85mwXC+c0o8WLPF1aQbjYBNYkvXw6zgzSICKhK/H/lDhJmFkiXeHN7JStIWEjAVmJX Uw1ImFPATqJ7Uhc7iC0sYCTxb95nsFUsQJ3dSzJAwrxA1X1TNzJD2IISPybfY4GYqCWxfudx JghbXmLzmrfMEFeqSzz6qwux30ji1+YKiAoRiX0v3jGC3CshcIxd4s+PCWD3sggISHybfIgF olVWYtMBZkggSEocXHGDZQKjxCwki2chWTwLyeJZSFYsYGRZxSiaWpBcUJyUXmSiV5yYW1ya l66XnJ+7iRESixN2M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955tzraqf6l3pWPVlhJD+V4e/E1EbDL9aBEY3/RAL/Wkn4OM6L0d1Y/+DwGfZzexMyfx+5 +bpG6LqUZssz6Wmv/SzeP3htF5fKIBeRsO6Tp//tH1L+Rx0jU1OuK+2X6j/WuC9McNWiwxp5 T0IvHXLoU3iVvUNYiaU4I9FQi7moOBEA0HYqNwsDAAA= 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: debugfs_remove_recursive(NULL) is safe this check is probably not required WARNING: min() should probably be min_t(u32, rx_left, dw_readw(dws, DW_SPI_RXFLR)) WARNING: else is not generally useful after a break or return WARNING: Missing a blank line after declarations WARNING: void function return statements are not generally useful Signed-off-by: Jingoo Han --- drivers/spi/spi-dw.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 670f0627f3bf..f6e1ee658720 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -135,8 +135,7 @@ static int mrst_spi_debugfs_init(struct dw_spi *dws) static void mrst_spi_debugfs_remove(struct dw_spi *dws) { - if (dws->debugfs) - debugfs_remove_recursive(dws->debugfs); + debugfs_remove_recursive(dws->debugfs); } #else @@ -177,7 +176,7 @@ static inline u32 rx_max(struct dw_spi *dws) { u32 rx_left = (dws->rx_end - dws->rx) / dws->n_bytes; - return min(rx_left, (u32)dw_readw(dws, DW_SPI_RXFLR)); + return min_t(u32, rx_left, dw_readw(dws, DW_SPI_RXFLR)); } static void dw_writer(struct dw_spi *dws) @@ -228,8 +227,9 @@ static void *next_transfer(struct dw_spi *dws) struct spi_transfer, transfer_list); return RUNNING_STATE; - } else - return DONE_STATE; + } + + return DONE_STATE; } /* @@ -471,10 +471,12 @@ static void pump_transfers(unsigned long data) */ if (!dws->dma_mapped && !chip->poll_mode) { int templen = dws->len / dws->n_bytes; + txint_level = dws->fifo_len / 2; txint_level = (templen > txint_level) ? txint_level : templen; - imask |= SPI_INT_TXEI | SPI_INT_TXOI | SPI_INT_RXUI | SPI_INT_RXOI; + imask |= SPI_INT_TXEI | SPI_INT_TXOI | + SPI_INT_RXUI | SPI_INT_RXOI; dws->transfer_handler = interrupt_transfer; } @@ -515,7 +517,6 @@ static void pump_transfers(unsigned long data) early_exit: giveback(dws); - return; } static int dw_spi_transfer_one_message(struct spi_master *master, @@ -619,6 +620,7 @@ static void spi_hw_init(struct dw_spi *dws) */ if (!dws->fifo_len) { u32 fifo; + for (fifo = 2; fifo <= 257; fifo++) { dw_writew(dws, DW_SPI_TXFLTR, fifo); if (fifo != dw_readw(dws, DW_SPI_TXFLTR))