From patchwork Tue Aug 8 12:04:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 9888031 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 C1B1260384 for ; Tue, 8 Aug 2017 12:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2D4A28889 for ; Tue, 8 Aug 2017 12:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7BF32888D; Tue, 8 Aug 2017 12:32:58 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 2096928889 for ; Tue, 8 Aug 2017 12:32:58 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From: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=kzYU6BoiZl0wFF7bp05Hb0FGbaQdRMq26EXgZxhk13E=; b=VLU g/iNV/q0DBrjX9QW/d+uhNk9e1ONNloMvHMO9BiQ0zxlRJBhRHF52vo9b2qSUGZgJjq1YgpJGCsSG 4WBfg/k3R2biKAfeHD9bz8G8fQ3+1jZO9SEEMAw5r5nVeFj5X+IuViYgJkEL5mr1yDj9PsH9Y8VgK qROJfLzOvcg/o+xgIWia5BsH/f+Ui1PSjxQ5kKfBslnFHHDIvdzkfvrnR9up+xBUdN2EeCIrbrJDO zUAMFttLZa7+WkWOfIbFeLK2S1EExe/nP+6xXHovLBGFzTGRyblQhl2WGHPiiYhYQvOJfBFki6ZPp V9I0hZ0PB6/MruMCUFFIbBjwakJxbKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1df3gv-0002T2-Bd; Tue, 08 Aug 2017 12:32:57 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1df3G3-0006qX-6g for linux-arm-kernel@bombadil.infradead.org; Tue, 08 Aug 2017 12:05:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type: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=sOT+J7NK9FQ3saqBkAI6aiC9fRESx1BiNzPyIeUotWA=; b=EUNtiJguTde0LbO/y+mXwayKU n5VsS6Iv81WHRa8n+hBEhUsc+iBUt2cw1kGuZttEfeFt4RQut3JU2AjsdHkuBIXryMbieuMeH2Q2e vBi2ds15r8yC0hWxZcgZxi6T2/I6FIVjMzR4CdDOJb2s7oFneY1j4v08l6abDMCfHrdHk9CjMqrmY gGOjKMTLsIq8309EOYIW1uuYdBiJLewN1XQLuGMLH6rn2ff2q13ff0UNtu3Mt0L0GVX+RFnM3OYw3 kXk3hGquY4akpFeKbVaBWVbUHUfELGaBMSg6Qhve/b+lxypl6AkVwCgH4KfQccLi4uCoCplbVeF9x syLqdAjTQ==; Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1df3Fx-0003kv-Vk for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2017 12:05:09 +0000 Received: by mail-wm0-x244.google.com with SMTP id y206so3577530wmd.5 for ; Tue, 08 Aug 2017 05:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=sOT+J7NK9FQ3saqBkAI6aiC9fRESx1BiNzPyIeUotWA=; b=qqQKq9S831wyuzHoS1QV9dvg9c60Kl9Mcj3QfJu/OluvqerwPlrHE+ZHizMU7q40Zw E+gwsSUEcPlDe7bFpMlm6zHwKWGXRGUrX0u9g0G5WAb94sj46ruueQyTH/LkC24oGRpu Nn3CG7+fpyruJCJwwP2eh2FFY9C3Jg+NvRUWHt5ei2bDZkWctjN8hzQdnVPH2/bbLs6n PUV63CbmFkt0l7+g8o9ZV+o7gPCurQ+oy8X0Z6xU9I0Mhehy2GgCdu+jdF6+2z7BvQtk SvbZNAxZvhHt08Uxj3mt7fnqliKzXTn4rbYkAJBXFhuB1Dr/cFg9Uyg2Bjq6J6mWTMTd lA6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=sOT+J7NK9FQ3saqBkAI6aiC9fRESx1BiNzPyIeUotWA=; b=fkE1sHjb58cT88dqHLF7PVLId4WHz92bECfaxZUWdCldFJYAyK9TUx4RThA95T8BhO RKYPTxDjgOClZxQgT0zeQBCzposHZDzjKnxKea8GR1fango9sd26YFH35nNiEwH4cyKp 4fuMqB+/A784Z/evKOXSZ52ecKvpz1n3U3pdzkF6rn9aMZJpN8CITLZVzCA0TAfmVrZE 2bsV/1bLk9JyVwYXxGsGU5r+2xp2993KGuFW+XLESjTigMOD1+0oSLEI8u9+PKiXpY/P QgsNbauRuRPaKtbSmsDU3TQxglVfZnoI9w3hNiCctYeZ9uDsb01O2lVjeY3b7zqbaRJX 31sw== X-Gm-Message-State: AHYfb5jqpkRmGbG/Jnn/2CNxDE+t2ELZm6E0WwiYxFmH4tes7DJMedyo LldPVwFGMzBmk7e+ X-Received: by 10.28.27.207 with SMTP id b198mr3142317wmb.96.1502193883168; Tue, 08 Aug 2017 05:04:43 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id e21sm993126wme.17.2017.08.08.05.04.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 08 Aug 2017 05:04:42 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH] iio: adc: Fix coding style violations Date: Tue, 8 Aug 2017 14:04:41 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170808_130506_381218_F85FD6D8 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Sai Krishna Potthuri , Lars-Peter Clausen , linux-iio@vger.kernel.org, Jonathan Cameron , Peter Meerwald-Stadler , Hartmut Knaack , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sai Krishna Potthuri This patch fix following checkpatch warnings in xadc driver 1. Prefer 'unsigned int' to bare use of 'unsigned'. 2. else is not generally useful after a break or return. 3. function definition argument 'struct xadc *' should also have an identifier name. Signed-off-by: Sai Krishna Potthuri Signed-off-by: Michal Simek --- drivers/iio/adc/xilinx-xadc-events.c | 38 +++++++++++++++++------------------- drivers/iio/adc/xilinx-xadc.h | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-events.c b/drivers/iio/adc/xilinx-xadc-events.c index 6d5c2a6f4e6e..dc0670308253 100644 --- a/drivers/iio/adc/xilinx-xadc-events.c +++ b/drivers/iio/adc/xilinx-xadc-events.c @@ -68,7 +68,7 @@ void xadc_handle_events(struct iio_dev *indio_dev, unsigned long events) xadc_handle_event(indio_dev, i); } -static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan, +static unsigned int xadc_get_threshold_offset(const struct iio_chan_spec *chan, enum iio_event_direction dir) { unsigned int offset; @@ -90,26 +90,24 @@ static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan, static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan) { - if (chan->type == IIO_TEMP) { + if (chan->type == IIO_TEMP) return XADC_ALARM_OT_MASK; - } else { - switch (chan->channel) { - case 0: - return XADC_ALARM_VCCINT_MASK; - case 1: - return XADC_ALARM_VCCAUX_MASK; - case 2: - return XADC_ALARM_VCCBRAM_MASK; - case 3: - return XADC_ALARM_VCCPINT_MASK; - case 4: - return XADC_ALARM_VCCPAUX_MASK; - case 5: - return XADC_ALARM_VCCODDR_MASK; - default: - /* We will never get here */ - return 0; - } + switch (chan->channel) { + case 0: + return XADC_ALARM_VCCINT_MASK; + case 1: + return XADC_ALARM_VCCAUX_MASK; + case 2: + return XADC_ALARM_VCCBRAM_MASK; + case 3: + return XADC_ALARM_VCCPINT_MASK; + case 4: + return XADC_ALARM_VCCPAUX_MASK; + case 5: + return XADC_ALARM_VCCODDR_MASK; + default: + /* We will never get here */ + return 0; } } diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h index f6f081965647..9069396d7622 100644 --- a/drivers/iio/adc/xilinx-xadc.h +++ b/drivers/iio/adc/xilinx-xadc.h @@ -76,7 +76,7 @@ struct xadc_ops { int (*setup)(struct platform_device *pdev, struct iio_dev *indio_dev, int irq); void (*update_alarm)(struct xadc *, unsigned int); - unsigned long (*get_dclk_rate)(struct xadc *); + unsigned long (*get_dclk_rate)(struct xadc *xadc); irqreturn_t (*interrupt_handler)(int, void *); unsigned int flags;