From patchwork Tue Jul 2 16:02:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13720021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEB0FC30658 for ; Tue, 2 Jul 2024 16:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Date:From:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TJWg4VePTkjqLfqefaqVpD2SR1o6ss+zysoNUR5oSxY=; b=BlkbvnIIEoMdG2i9Vxn5UFwnCD RzOCcsOnjFfgINi9C+SCGG59jHIIUb0J5Bm/esrB5GFjphJk+G/UTAtwX3mOxu/gWHq8k2Rrv/xMJ s04Ih3sDXyvrS9wzci6bA9zrvGewwOJadyjGksxyK1m7Fpo1oouvcjv4+sYrjnOLC7K8OK1A2vdk6 2URItLnwR+qRAvSTSsBfaX6WjMFymg/tmzI6P+HM0J7fSCpaLXYtEB2waj7bM8ysZ1p+v/Au7+Ksp djqUwr9Hv0nGqosVfTaaDu63ySeGJMgA23Lc9xMBq8Mlhm3OPhQeS87kkfhgfbAXfSB7GJDR3I17h KLTUlPRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg08-00000007JJo-03LH; Tue, 02 Jul 2024 16:05:04 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxr-00000007IRN-2O8P for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8C1DB61EB2; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 2387EC116B1; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=yOWVypS4kSOx1G29xEk/xKSpqDyhIwoOhx6i3r0Qfts=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=kwn1cs4okhnkZgPsHVSAptADCRALmck4WOXA+YKCvDogxZof0aUFRcfTEmRCWmRxc O88Fh0ZrsndbCsax/QVZkZCIEWCAp8x2T05jujRk1NePQ7m54je4OQlbyYDvWD+HRK AhyLxgBD+lGr/sy6GupLSvtHU+T3ezd3l8Cg3SF2aVLtAVqsu+pOFd3hNFV2ff9Yfq aN/sbA4AWr7aSMp8HdNf7Fh1SVeybPR1eyIFkXM4kHhDjTGSoLVC227Pnt58VZyix0 xRFPwGuPHXGLOE7uEoQoOkCSdEbXcnGiW5qF/LkbQcW3jtqhcRECmohNDIhy3tqbjT p35gUew3vajUA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1964FC30658; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:50 +0200 Subject: [PATCH 18/20] iio: adc: at91_adc: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-18-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=908; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=W/t1QLnOMBghJ3cBP0Sz8vy2Yubdg+XmvmGHI/DD3L0=; b=UgykRrQ4gxnOiL92MVtaXiv5JRu0qLvRXJ3en/zfBLdcF1+6f4aouctfdqT139Xlq0n1yySoq /o3KRpCxAeyDCNviZtJkLh3MEekKinZgzRRLzBwuc1kxonACiBumgdF X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_090243_739946_9DF8620B X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: nuno.sa@analog.com Cc: Alexandre Belloni , Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , Claudiu Beznea , Guenter Roeck , Dmitry Rokosov , Benson Leung , Jonathan Cameron Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- drivers/iio/adc/at91_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index eb501e3c86a5..af4b0224076f 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -268,9 +268,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p) struct iio_chan_spec const *chan; int i, j = 0; - for (i = 0; i < idev->masklength; i++) { - if (!test_bit(i, idev->active_scan_mask)) - continue; + iio_for_each_active_channel(idev, i) { chan = idev->channels + i; st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel)); j++;