From patchwork Tue Nov 6 18:48:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Slawomir Stepien X-Patchwork-Id: 10671315 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 03D3413A4 for ; Tue, 6 Nov 2018 19:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E31172B13D for ; Tue, 6 Nov 2018 19:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D27D92B148; Tue, 6 Nov 2018 19:13:20 +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 AAF002B13D for ; Tue, 6 Nov 2018 19:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387624AbeKGEj7 (ORCPT ); Tue, 6 Nov 2018 23:39:59 -0500 Received: from smtpo.poczta.interia.pl ([217.74.65.235]:41691 "EHLO smtpo.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387537AbeKGEj5 (ORCPT ); Tue, 6 Nov 2018 23:39:57 -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 19:48:00 +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, =?utf-8?b?U8WC?= =?utf-8?b?YXdvbWlyIFN0xJlwaWXFhA==?= Subject: [PATCH] staging: iio: adc: ad7280a: do not pass the copy of struct element Date: Tue, 6 Nov 2018 19:48:15 +0100 Message-Id: <20181106184815.27910-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=1541530082; bh=C2UTTCPcBfBDs84kyLnKsGbTJFC7+fYaxIPg4M6H2q0=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:From:To:Cc:Subject: Date:Message-Id:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Interia-Antivirus; b=vVNQMuf4zIz5fKe2mM9/nYCgx1xaHshWdoGAcU6X8p8PMkdtfcOwSRpWSMxo0dj4K 1tmChi2T8jenhrF2lwxfSjKgr6rj55O+IYA/+26Ow53LfcHpEXQKqyQbmh00Fc+h+F cmASmhwpWd2Cg12MytW95vqFE9ZU/thIo+FuKLeQ= 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 From: Sławomir Stępień There is no need to pass this parameter since is always a copy of parameter that is available via st pointer. Signed-off-by: Sławomir Stępień --- Note: this has been rebased on kernel/git/jic23/iio.git testing branch. I hope that's OK! --- 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);