From patchwork Wed Feb 14 11:10:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10219231 X-Patchwork-Delegate: kvalo@adurom.com 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 3E8D660467 for ; Wed, 14 Feb 2018 15:15:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3133A28CA7 for ; Wed, 14 Feb 2018 15:15:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25B7728D0A; Wed, 14 Feb 2018 15:15:09 +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=-5.3 required=2.0 tests=BAYES_00, DATE_IN_PAST_03_06, 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 A2F8228CA7 for ; Wed, 14 Feb 2018 15:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031179AbeBNPPH (ORCPT ); Wed, 14 Feb 2018 10:15:07 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:26099 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031174AbeBNPPG (ORCPT ); Wed, 14 Feb 2018 10:15:06 -0500 X-IronPort-AV: E=Sophos;i="5.46,512,1511852400"; d="scan'208";a="11142589" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Feb 2018 08:15:06 -0700 Received: from ajaysk-VirtualBox.mchp-main.com (10.10.76.4) by chn-sv-exch07.mchp-main.com (10.10.76.108) with Microsoft SMTP Server id 14.3.352.0; Wed, 14 Feb 2018 08:15:05 -0700 From: Ajay Singh To: CC: , , , , , , Ajay Singh Subject: [PATCH 5/6] staging: wilc1000: fix line over 80 characters in wilc_spi_read_int() Date: Wed, 14 Feb 2018 16:40:14 +0530 Message-ID: <1518606615-14404-6-git-send-email-ajay.kathat@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518606615-14404-1-git-send-email-ajay.kathat@microchip.com> References: <1518606615-14404-1-git-send-email-ajay.kathat@microchip.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Refactor wilc_spi_read_int() to fix the line over 80 char issues reported by checkpatch.pl script. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_spi.c | 57 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index fddc0db..7c58beb8 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -939,45 +939,46 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status) int happened, j; u32 unknown_mask; u32 irq_flags; + int k = IRG_FLAGS_OFFSET + 5; if (g_spi.has_thrpt_enh) { ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE, int_status); - } else { - ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, - &byte_cnt); - if (!ret) { - dev_err(&spi->dev, - "Failed read WILC_VMM_TO_HOST_SIZE ...\n"); - goto _fail_; - } - tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK; + return ret; + } + ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, &byte_cnt); + if (!ret) { + dev_err(&spi->dev, + "Failed read WILC_VMM_TO_HOST_SIZE ...\n"); + goto _fail_; + } + tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK; - j = 0; - do { - happened = 0; + j = 0; + do { + happened = 0; - wilc_spi_read_reg(wilc, 0x1a90, &irq_flags); - tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET); + wilc_spi_read_reg(wilc, 0x1a90, &irq_flags); + tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET); - if (g_spi.nint > 5) { - wilc_spi_read_reg(wilc, 0x1a94, - &irq_flags); - tmp |= (((irq_flags >> 0) & 0x7) << (IRG_FLAGS_OFFSET + 5)); - } + if (g_spi.nint > 5) { + wilc_spi_read_reg(wilc, 0x1a94, &irq_flags); + tmp |= (((irq_flags >> 0) & 0x7) << k); + } - unknown_mask = ~((1ul << g_spi.nint) - 1); + unknown_mask = ~((1ul << g_spi.nint) - 1); - if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) { - dev_err(&spi->dev, "Unexpected interrupt (2): j=%d, tmp=%x, mask=%x\n", j, tmp, unknown_mask); - happened = 1; - } + if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) { + dev_err(&spi->dev, + "Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n", + j, tmp, unknown_mask); + happened = 1; + } - j++; - } while (happened); + j++; + } while (happened); - *int_status = tmp; - } + *int_status = tmp; _fail_: return ret;