Message ID | 20181003155522.GA31045@embeddedor.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE793112B for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 3 Oct 2018 16:27:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1E6A28F37 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 3 Oct 2018 16:27:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D540A28F4A; Wed, 3 Oct 2018 16:27:08 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F0AD28F37 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 3 Oct 2018 16:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ahI4nv3/LMXnzCVTy4miMNO8GXV3o9uwxRVKlBKO2o8=; b=CMbcavS1HOhW+z BA9YMCGu7MGSV7WrGiAJrVGdoaNAydAmq5ONH1IPVkzDiwIEBv7ZZv9sUouhzqvrw/SZtkpYdDYPP EvgwlRZ3gXWx5oPpuXqcT5eiXXtRBNnsJ+hhZzIoFeOwLclvhUaXZgI9xd6w7bNTAPd3zSqrq+d0T tQo7ptxdUNQKJo4sSt2iGhHFA1wEXXe8CPNxwh6hLSwrUM2eIIAXz4eopTymtpCN4Bzpjiwik2oJD ezdSrH2iJVOBVICta9LOKiokCYsXTb9jjWEvKbWBP7yDs5Q5EoeDpW0058OzNBll0ilKEBRTu7k0d nZCd3Lvh/wtDaHav2XMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7jzA-0006Fi-3W; Wed, 03 Oct 2018 16:26:52 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7jyc-00062Z-9p for linux-arm-kernel@bombadil.infradead.org; Wed, 03 Oct 2018 16:26:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=waX7M2SQqCSSYlX9JPh6S6q+9tW8NmDaIlUwQdIWyNc=; b=EH5MQNRsE/VOk+j1PTg2DHXfJH dE8mm0Y+kMf3YxECZSmqMzu/zPI9GAbruxQdSn/c7C2Yi9GPeJxeJ55OsCFeJP2w38UZtIL/O78mL 2RCVtAhrmX3qALhJrV6MIZ0wLiOzNrw1bAvobwSFRZCT/+JFudXTbQXwHG11eKCGj+CXCgeSat/cm g1CWl9oiCKKsI+ol4ACEaB5acB0m7RfOZ2Fe1XYftvf/gyZZFrVUfowpds330iOshH+igwhFh3XRs xTN9Qq81xdX3MNjpYE6sQSQz4qY1bI58azhG8NyC+Y7j8qpnBkw2+DWeh1E3d1n2O9jjCAZiDaUmD jNZUnWZw==; Received: from gateway30.websitewelcome.com ([192.185.145.3]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7jV3-00038A-R6 for linux-arm-kernel@lists.infradead.org; Wed, 03 Oct 2018 15:55:46 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway30.websitewelcome.com (Postfix) with ESMTP id C2AE818E7C for <linux-arm-kernel@lists.infradead.org>; Wed, 3 Oct 2018 10:55:32 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 7jUlgJwPW8YaU7jUngmlbo; Wed, 03 Oct 2018 10:55:32 -0500 X-Authority-Reason: nr=8 Received: from 174.206.93.92.rev.sfr.net ([92.93.206.174]:40462 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from <gustavo@embeddedor.com>) id 1g7jUj-004Fqp-Dc; Wed, 03 Oct 2018 10:55:26 -0500 Date: Wed, 3 Oct 2018 17:55:22 +0200 From: "Gustavo A. R. Silva" <gustavo@embeddedor.com> To: Daniel Mack <daniel@zonque.org>, Haojian Zhuang <haojian.zhuang@gmail.com>, Robert Jarzmik <robert.jarzmik@free.fr>, Mark Brown <broonie@kernel.org> Subject: [PATCH] spi: pxa2xx: Rewrite switch code block in interrupt_transfer Message-ID: <20181003155522.GA31045@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 92.93.206.174 X-Source-L: No X-Exim-ID: 1g7jUj-004Fqp-Dc X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174.206.93.92.rev.sfr.net (embeddedor) [92.93.206.174]:40462 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 34 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181003_115545_937007_A69114E4 X-CRM114-Status: UNSURE ( 6.02 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
spi: pxa2xx: Rewrite switch code block in interrupt_transfer
|
expand
|
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index fc9aac2..d68f511 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -665,9 +665,11 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data) bytes_left = drv_data->rx_end - drv_data->rx; switch (drv_data->n_bytes) { case 4: - bytes_left >>= 1; + bytes_left >>= 2; + break; case 2: bytes_left >>= 1; + break; } rx_thre = pxa2xx_spi_get_rx_default_thre(drv_data);
Rewrite switch code block to directly do the expected number of shifts in each case and have break statements. Addresses-Coverity-ID: 1056539 ("Missing break in switch") Suggested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> --- drivers/spi/spi-pxa2xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)