From patchwork Tue Nov 6 21:43:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slawomir Stepien X-Patchwork-Id: 10671467 Return-Path: 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 EE7BC15A6 for ; Tue, 6 Nov 2018 21:43:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0BE02B071 for ; Tue, 6 Nov 2018 21:43:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4E892B077; Tue, 6 Nov 2018 21:43:02 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,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 BF6BB2B071 for ; Tue, 6 Nov 2018 21:43:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbeKGHKQ (ORCPT ); Wed, 7 Nov 2018 02:10:16 -0500 Received: from smtpo.poczta.interia.pl ([217.74.65.235]:46321 "EHLO smtpo.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbeKGHKQ (ORCPT ); Wed, 7 Nov 2018 02:10:16 -0500 X-Interia-R: Interia X-Interia-R-IP: 188.121.17.172 X-Interia-R-Helo: Received: from localhost (ipv4-188-121-17-172.net.internetunion.pl [188.121.17.172]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by www.poczta.fm (INTERIA.PL) with ESMTPSA; Tue, 6 Nov 2018 22:42:56 +0100 (CET) From: Slawomir Stepien To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, gregkh@linuxfoundation.org, Slawomir Stepien Subject: [PATCH v2] staging: iio: adc: ad7280a: do not pass the copy of struct element Date: Tue, 6 Nov 2018 22:43:08 +0100 Message-Id: <20181106214308.10619-1-sst@poczta.fm> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1541540578; bh=c7vJKDZkOWBNyaENFPGnusd/5egFy/LVknfnIg9r7nY=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:From:To:Cc:Subject: Date:Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-Interia-Antivirus; b=mHTG2JzPucVUmBz/BpUqz13v1ab4huDBoqy6I5w1Y37+ALBJRyHDUJvbRnMK9GsRn wP94rVaolDJw06VYDKjFSftnRr3hmknr+vl7dWP+pwDZAavYm7k9Ewd4vmoKIrfmCb 2dc0wMDOhkX1qQyTlaOWvxviCVtRTlziNxMgDcQA= Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no need to pass this parameter since is always a copy of parameter that is available via st pointer. Signed-off-by: Slawomir Stepien --- Note: this has been rebased on kernel/git/jic23/iio.git testing branch. I hope that's OK! Changes since v1: * Change my email address --- drivers/staging/iio/adc/ad7280a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 89c2c2deca64..fc6237ddb460 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -291,7 +291,7 @@ static int ad7280_read_channel(struct ad7280_state *st, unsigned int devaddr, return (tmp >> 11) & 0xFFF; } -static int ad7280_read_all_channels(struct ad7280_state *st, unsigned int cnt, +static int ad7280_read_all_channels(struct ad7280_state *st, unsigned int *array) { int i, ret; @@ -312,7 +312,7 @@ static int ad7280_read_all_channels(struct ad7280_state *st, unsigned int cnt, ad7280_delay(st); - for (i = 0; i < cnt; i++) { + for (i = 0; i < st->scan_cnt; i++) { ret = __ad7280_read32(st, &tmp); if (ret) return ret; @@ -687,7 +687,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) if (!channels) return IRQ_HANDLED; - ret = ad7280_read_all_channels(st, st->scan_cnt, channels); + ret = ad7280_read_all_channels(st, channels); if (ret < 0) goto out; @@ -791,7 +791,7 @@ static int ad7280_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_RAW: mutex_lock(&st->lock); if (chan->address == AD7280A_ALL_CELLS) - ret = ad7280_read_all_channels(st, st->scan_cnt, NULL); + ret = ad7280_read_all_channels(st, NULL); else ret = ad7280_read_channel(st, chan->address >> 8, chan->address & 0xFF);