From patchwork Thu Aug 10 06:30:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 9892785 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 5217D60236 for ; Thu, 10 Aug 2017 06:31:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45B91289FD for ; Thu, 10 Aug 2017 06:31:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AD0F28AC9; Thu, 10 Aug 2017 06:31:35 +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 A508C289FD for ; Thu, 10 Aug 2017 06:31:33 +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=y9L1fjOW6HyuEwJRZX+qP9IKbZx2Cg4JTBkDWBTWbjk=; b=BP9 m4vcUdfgFFjvzwl21rvBCICsgqyiy9hbUkEuuYK4qYrWPY4J5yIY0WungpKgEDlZUQz4ja2sSDHEP JMtlzwqJZulm7KTqTmOFsXUZ1V7x15NGC6G6eXqCVa9LEiJ3ls35eaVxNLtSzCoPIdvp9UE5SY+4d Wz6jVnRqGlEi3QZAagwsUvBz2MzzT5puy/LnkA/qhvTGmcahjnK1WNPaEI9GgLGiKX6s8i6NkmWgt PLj7khUimmgqhfTJLR3dTku43O7qdTp6fXXxS/n15BMbtdTy2/qLqZX91r5Fje0fqK9nBk08/o735 Zn8dJoyE9HCvkDbc5FNOJY10/ZdWs4w==; 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 1dfgzd-0002SK-SN; Thu, 10 Aug 2017 06:30:53 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dfgzY-0002PC-Gv for linux-arm-kernel@lists.infradead.org; Thu, 10 Aug 2017 06:30:51 +0000 Received: by mail-wm0-x243.google.com with SMTP id t138so1808692wmt.4 for ; Wed, 09 Aug 2017 23:30:26 -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=DvK/YDdWqIgH3Ahzi3oFeUxvL7hs4vm4MvFaVT52Zvs=; b=m6FFwouvRt4XxXFLOXgdzsCID5eaqyVSfw+k4kmlNsYnganFD0caJsbARMK6MIJLWS lnTzlrd7SmS4xPhqA+k2IjfLeeU7j3liCJNTgBGlZrRkeGS1aHaeTbf56H54aQx48UJk kgFjIcyqK9/mRLhmZLc7pgw923ez6TBcRJN3gmJIeml0QOeXWfhxWU283JDJ2HrrJwSr SKdagp9nY9KUwBzaUJqqNBdF3CRhq+ArFHcTzmrNuPrRr5Qexi57A0n/NwhrIeqsbu8e /15voLB+2V85IcGBcxkKYX2FYW5oMyXPTc+t3w/366cNKvcBBAcWphaOaKVjqdE11gT/ s41w== 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=DvK/YDdWqIgH3Ahzi3oFeUxvL7hs4vm4MvFaVT52Zvs=; b=D3o47DhnrUzCi/b1yY6TZO0dCkjCYPGRGJys7+Ax8DCyq0o7znQ7aMmWFWPEwH3GMm 2PSFvMU+d/wSzRHcOraYVI3+cnClJ81h/o7Q7HWx9oT1WlmLJQqcqLIDl8Bo9Ehtt8as NBSGOdk6eU/wDey1Jq8E6AqIweDeL3HWi408CqVlJnxGg4Ya2Znrk/tuncNPBuzraBRr Eb0H8vX7VshqKcYILmU7LyVzrHW+i6Ge9nvRXEaq8f2UFAw+UmG9GsRp1Q5F94vTEjGv j9R6lH/ySLT+b1vCO4nJbW10TkkCViAlyPTWaxViriPoGkapGHvNPkExIDcJsyDoj24Y 922Q== X-Gm-Message-State: AHYfb5hqb5mNCGm605f0oOgC530meJVyTphE/Lx1SggZWk1oa40SXPMz NvZqowN8vgKp7Q0k X-Received: by 10.28.87.193 with SMTP id l184mr6433576wmb.121.1502346625247; Wed, 09 Aug 2017 23:30:25 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id g72sm6447769wmc.31.2017.08.09.23.30.24 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 09 Aug 2017 23:30:24 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH v2] iio: adc: Fix coding style violations Date: Thu, 10 Aug 2017 08:30:20 +0200 Message-Id: <4d8fa659c811106d57122b24ae8e9c075dc8843a.1502346616.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170809_233048_823389_7C9C5E09 X-CRM114-Status: GOOD ( 12.98 ) 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. fill all function definition arguments with identifier name Signed-off-by: Sai Krishna Potthuri Signed-off-by: Michal Simek --- Changes in v2: - Fix all functions definition arguments in header with identifier name - Change commit message to reflect v2 changes both reported by: Joe Perches drivers/iio/adc/xilinx-xadc-events.c | 38 +++++++++++++++++------------------- drivers/iio/adc/xilinx-xadc.h | 10 +++++----- 2 files changed, 23 insertions(+), 25 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..62edbdae1244 100644 --- a/drivers/iio/adc/xilinx-xadc.h +++ b/drivers/iio/adc/xilinx-xadc.h @@ -71,13 +71,13 @@ struct xadc { }; struct xadc_ops { - int (*read)(struct xadc *, unsigned int, uint16_t *); - int (*write)(struct xadc *, unsigned int, uint16_t); + int (*read)(struct xadc *xadc, unsigned int reg, uint16_t *val); + int (*write)(struct xadc *xadc, unsigned int reg, uint16_t val); 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 *); - irqreturn_t (*interrupt_handler)(int, void *); + void (*update_alarm)(struct xadc *xadc, unsigned int alarm); + unsigned long (*get_dclk_rate)(struct xadc *xadc); + irqreturn_t (*interrupt_handler)(int irq, void *devid); unsigned int flags; };