From patchwork Tue Jul 2 16:02:33 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: 13720013 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 04567C30658 for ; Tue, 2 Jul 2024 16:04:02 +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=10zJwQdsGuhDlsuIHv6vlHCfqT5ZnUjSUcTE/CIhTyg=; b=icjCxiPpN49m2sX+rbjQplRtGB jhoBKY6CZcX8NHQr75kltdJrh8EXNlGJRk635w19DVXEzxsDvBJCILwFDZPH4IcQH7gz/3P6gC7KV TrZIdpNlPOv+WgPLc+qLVNYNi3RTz39BwejB/STiDyvesRCjIqAgHqM/KAdWmVwPTjZ5Rg9J0JLzj +Qyc3jpB3F3jJXhZAECfu1r96kXjdPExZxxacJEpaFGitYiUlxzGOADwo6ajA59MfychGDHZ58/wH mbaZFLzAAioYE09SeTrrI9z0e4EBI3Pd8QedZlBuJDFqNbMCc1QmJTcZNW8r3feBvIFBpf4akhjB1 34ZUOPfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfyu-00000007InI-3O9A; Tue, 02 Jul 2024 16:03:48 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxp-00000007IOK-2giV for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D88BCCE14E7; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 13677C4AF0A; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=X9U2RqNBvqNInuBI9oKZcFsFepJn/tehK2K25jnqvTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bemJDZw+qLgJsnubBLLySuI0flI8N6XRBymD0l44shxoUyB4GuQnbBCWOrXjkP/mN ezzakjbZWke3Dg6HsD380rRn3XK0SGdBoKriDScl2wxZRbDBgDvjeqqNcq3PC+X2fx DCT+GuZECD2BlIdX2fIxz4FDXl7HJ8A6faOlVARtKNQHIEzxtUjg5N92mG+BMwcuTg 70Htz45XYPEfb6LGZfVE5GSQ/OxV+WQzwvmRExHJsZoFa/eQ+O5qIlTfeEVhIv/AV3 1QBrnf5NkklVwIf41REFxGym/7LEGqPdbFyScqXH5XhtkXHIbrtkXJKKZj3u1gnPC4 UDjtuJkjcZNvQ== 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 F1AF8C30658; Tue, 2 Jul 2024 16:02:38 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:33 +0200 Subject: [PATCH 01/20] iio: core: add accessors 'masklength' MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-1-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=1719936156; l=1677; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=EA7SSU5JCACZ9RbuyelW015qMw9c7NJ9Gp/LUGrm0oI=; b=WOeC8On1W5DCuG3LfamYH01OA5F0KKWMc0DWI3AWAeSbOQx46FElbbhV4CKkRfZy3+gYMQqWC lf31gWkzbbECs1Z5B21bh3N363YaVGrn7aRYnhS2HeqXObSmuYw+cFY 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_090242_495864_F13F9FE5 X-CRM114-Status: GOOD ( 11.95 ) 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 'masklength' is supposed to be an IIO private member. However, drivers (often in trigger handlers) need to access it to iterate over the enabled channels for example (there are other reasons). Hence, a couple of new accessors are being added: * iio_for_each_active_channel() - Iterates over the active channels; * iio_get_masklength() - Get length of the channels mask. The goal of these new accessors is to annotate 'masklength' as private as soon as all drivers accessing it are converted to use the new helpers. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- include/linux/iio/iio.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 894309294182d..dd6bbc468283e 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -855,6 +855,24 @@ static inline const struct iio_scan_type return &chan->scan_type; } +/** + * iio_get_masklength - Get length of the channels mask + * @indio_dev: the IIO device to get the masklength for + */ +static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev) +{ + return indio_dev->masklength; +} + +/** + * iio_for_each_active_channel - Iterated over active channels + * @indio_dev: the IIO device + * @chan: Holds the index of the enabled channel + */ +#define iio_for_each_active_channel(indio_dev, chan) \ + for_each_set_bit((chan), (indio_dev)->active_scan_mask, \ + iio_get_masklength(indio_dev)) + ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals); int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, From patchwork Tue Jul 2 16:02:34 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: 13720007 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 2C79EC30658 for ; Tue, 2 Jul 2024 16:03:11 +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=Li93KXuXTOLKi7hnVaBKKxKJAckoq+1BEvC4P8lETFo=; b=YQ+J6nxl2g/ZC3iG+5eomXpXGg bcLiBMGbcVeClGw81Mq8PlEv6jsfFcBLrpqC8V7vvS9/N57W4plqf1ODKWAZv6P8uYhMdMvu7QA0j RHlz6E/bfaZwCc+fIKkbwRIyySF7AoRD4eu4KxPUBE2jaXwi+YGx0ss8UHVEOrnEzTjx0sgtlRTjx U58wBL94hGEpukNtJ6lVpLrR69nZ9mn1nmkvTlCRJNejwnNm8541Iafmcd8Xko+Km3v9Hv5hcr417 f+bb8+WJ9J4CMfk3G0YxuMrByE+dfzQB/zkNncx0xZbV2SeEJ5fY8YBO6kqBt2e43Hyh01RNu3nuz +7AWhVdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfy1-00000007IVp-31RY; Tue, 02 Jul 2024 16:02:53 +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 1sOfxo-00000007IOF-1zMT for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 735B161E40; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 2429FC4AF07; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=ihOzVGJqm0d6Bf+2v8BGqtXAu3mpTzxXVeZwgRlF1Mc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cGuOy2AE08q77TRgAM5guB04jdSAG1x2AN/lrBk+xF9n/RVcKtjtzIB0fM6BJosrF ZA06zsWpE/FlxZX3Jc9kCnENk5/PUhMnUfK4TOQG+V0jpU2Ko+pnuCEk4jmyzSdu9d EdHjYTN+XEr+4ZLST1iclSyyJJWwfErlVxdIQfSgATSg7U+id/xPQZhtMOdXwMJFBU 4pxBd49SNw73EzjWAknnoq1+93obLJ3DHlD8gPJ17cCj+sTlp/jYvTl5I3iGber6vP cJHOeYRO5OdJkZV4EV4I5E182HJP0D3MDm7url8LH8hfD3qbL7asrsOr26mpNShkup JHebQSwf+uLNg== 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 11C5FC3065D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:34 +0200 Subject: [PATCH 02/20] iio: core: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-2-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=1719936156; l=787; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=q8IX5Pt5A6KGno27QoxN2X3k3j64RKvI5e+ShjWeyFk=; b=ssQKkLuKZ5MrR4JWpkmj+KsOh1I/ZpdqwlW13UWmcM9OVrQdUyCjMgixEpP0nWba20kAbq0P8 vrxtwleODJGByn7di9rpyaB1q/aljuXsXM+tXlAhZJwcxpFg222xGmX 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_090240_589523_32528872 X-CRM114-Status: GOOD ( 11.80 ) 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_get_masklength() to access '.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/industrialio-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 2f185b3869495..e392a10aaf320 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1907,7 +1907,7 @@ static void iio_sanity_check_avail_scan_masks(struct iio_dev *indio_dev) int i; av_masks = indio_dev->available_scan_masks; - masklength = indio_dev->masklength; + masklength = iio_get_masklength(indio_dev); longs_per_mask = BITS_TO_LONGS(masklength); /* From patchwork Tue Jul 2 16:02:35 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: 13720016 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 19063C30658 for ; Tue, 2 Jul 2024 16:04:28 +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=4zgQ1HyRYUIukXB8W/TbZKQkLb+4l3aeOb0KNIAsF04=; b=3ig/L0JxAANUNb+Fx1zVz7xhNt Xpj8CpCy//ZnyXEQztruF7Iv5NLJxVYaoqRdEUO8JTUo9Z5lC8Yp+YIZoU0Gz9ohjWDS9+5lv2u8U wuqBZx11Z1gOGuP5TPgPdDqBHFdx278fu8q/PlvVKZ/8NL93Y0KqPOmLazI7qrzayNjijqVQWNzgW 1dKF9I4naByzsbqCv4MTT/0KlVsxrK2lRJYCmTiKayU6DrwHccvmsCLpjKtRaDV0kV0VI1dsrRpcR y1EwT9Jo8MxmyN8P+eIx5nTIZF9kBB8+vb1rRdFXYkCCvW5jtwpsp7GFhTd1rB78hu+42/bHvCUd3 rLOhQiWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzM-00000007Izq-3pKS; Tue, 02 Jul 2024 16:04:16 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IPS-1pZp for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 40246CE1D78; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 2D908C4AF0D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=H6knCmshjK5jGEsidqg9p/dgF02XphFvTsPHqzn4WQw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=B8ACQCOBSeXAMiWqKyyqtsTCs74VAAHr503UAPluDfd1+Ch9KQW1z4c7ILOQy72E+ qRT7aPuRAuLdaqchknQHgetoXFjBbhGS1cDXg6tc8uE//VsfwpdfRjVA1uegXLmhRr SZJ/r1jJjiJmX7EF80VUJIL/oJRRcqbcTWeJJxpBq6CkelmfK3GK3Smxlwg2baHKmk Q3X0DZeLJc21GI+YTzCZ2wP3gpDgHn1B4ZHyT04Ly5u6wcRJ6OvDu6iZeLmKlxlmSl 9nKGpc4oKhncgjOlgiFUYKXYP42H1QgIwqTcpeccj6KJlQQas1FwriZR1w4FvGoow/ U8v74wm39pdEA== 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 1F9B7C3065E; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:35 +0200 Subject: [PATCH 03/20] iio: buffer: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-3-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=1719936156; l=8943; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=U7dr1egZgx9NyisqCoR3KT604oyD4R25bPaOlNgH5Bg=; b=GJ1AZCX6hZqMIVksHzM6CH1VBok4DW6f0RMeoXqxnKC2jOlLABH/eJIND/PEHVWvtyddGVxTV LjVguhviQOeA7/zdTDikSWTmyzmmqGOdJEPwuoReCfjpCo6L0VhKQYN 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_006510_2DB69854 X-CRM114-Status: GOOD ( 21.23 ) 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_get_masklength() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. While at it, remove some unneeded line breaks. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-cb.c | 2 +- drivers/iio/buffer/industrialio-hw-consumer.c | 4 +-- drivers/iio/industrialio-buffer.c | 50 ++++++++++++--------------- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c index 4c12b7a94af59..4befc9f55201e 100644 --- a/drivers/iio/buffer/industrialio-buffer-cb.c +++ b/drivers/iio/buffer/industrialio-buffer-cb.c @@ -77,7 +77,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, } cb_buff->indio_dev = cb_buff->channels[0].indio_dev; - cb_buff->buffer.scan_mask = bitmap_zalloc(cb_buff->indio_dev->masklength, + cb_buff->buffer.scan_mask = bitmap_zalloc(iio_get_masklength(cb_buff->indio_dev), GFP_KERNEL); if (cb_buff->buffer.scan_mask == NULL) { ret = -ENOMEM; diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c index fb58f599a80b1..526b2a8d725d1 100644 --- a/drivers/iio/buffer/industrialio-hw-consumer.c +++ b/drivers/iio/buffer/industrialio-hw-consumer.c @@ -52,6 +52,7 @@ static const struct iio_buffer_access_funcs iio_hw_buf_access = { static struct hw_consumer_buffer *iio_hw_consumer_get_buffer( struct iio_hw_consumer *hwc, struct iio_dev *indio_dev) { + unsigned int mask_longs = BITS_TO_LONGS(iio_get_masklength(indio_dev)); struct hw_consumer_buffer *buf; list_for_each_entry(buf, &hwc->buffers, head) { @@ -59,8 +60,7 @@ static struct hw_consumer_buffer *iio_hw_consumer_get_buffer( return buf; } - buf = kzalloc(struct_size(buf, scan_mask, BITS_TO_LONGS(indio_dev->masklength)), - GFP_KERNEL); + buf = kzalloc(struct_size(buf, scan_mask, mask_longs), GFP_KERNEL); if (!buf) return NULL; diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 0138b21b244f0..389bfb238b510 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -473,18 +473,19 @@ static bool iio_validate_scan_mask(struct iio_dev *indio_dev, static int iio_scan_mask_set(struct iio_dev *indio_dev, struct iio_buffer *buffer, int bit) { + unsigned int masklength = iio_get_masklength(indio_dev); const unsigned long *mask; unsigned long *trialmask; - if (!indio_dev->masklength) { + if (!masklength) { WARN(1, "Trying to set scanmask prior to registering buffer\n"); return -EINVAL; } - trialmask = bitmap_alloc(indio_dev->masklength, GFP_KERNEL); + trialmask = bitmap_alloc(masklength, GFP_KERNEL); if (!trialmask) return -ENOMEM; - bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength); + bitmap_copy(trialmask, buffer->scan_mask, masklength); set_bit(bit, trialmask); if (!iio_validate_scan_mask(indio_dev, trialmask)) @@ -492,12 +493,11 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev, if (indio_dev->available_scan_masks) { mask = iio_scan_mask_match(indio_dev->available_scan_masks, - indio_dev->masklength, - trialmask, false); + masklength, trialmask, false); if (!mask) goto err_invalid_mask; } - bitmap_copy(buffer->scan_mask, trialmask, indio_dev->masklength); + bitmap_copy(buffer->scan_mask, trialmask, masklength); bitmap_free(trialmask); @@ -517,7 +517,7 @@ static int iio_scan_mask_clear(struct iio_buffer *buffer, int bit) static int iio_scan_mask_query(struct iio_dev *indio_dev, struct iio_buffer *buffer, int bit) { - if (bit > indio_dev->masklength) + if (bit > iio_get_masklength(indio_dev)) return -EINVAL; if (!buffer->scan_mask) @@ -733,8 +733,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, int length, i, largest = 0; /* How much space will the demuxed element take? */ - for_each_set_bit(i, mask, - indio_dev->masklength) { + for_each_set_bit(i, mask, iio_get_masklength(indio_dev)) { length = iio_storage_bytes_for_si(indio_dev, i); if (length < 0) return length; @@ -855,6 +854,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, struct iio_device_config *config) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + unsigned int masklength = iio_get_masklength(indio_dev); unsigned long *compound_mask; const unsigned long *scan_mask; bool strict_scanmask = false; @@ -863,7 +863,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, unsigned int modes; if (insert_buffer && - bitmap_empty(insert_buffer->scan_mask, indio_dev->masklength)) { + bitmap_empty(insert_buffer->scan_mask, masklength)) { dev_dbg(&indio_dev->dev, "At least one scan element must be enabled first\n"); return -EINVAL; @@ -917,7 +917,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, } /* What scan mask do we actually have? */ - compound_mask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL); + compound_mask = bitmap_zalloc(masklength, GFP_KERNEL); if (!compound_mask) return -ENOMEM; @@ -927,20 +927,19 @@ static int iio_verify_update(struct iio_dev *indio_dev, if (buffer == remove_buffer) continue; bitmap_or(compound_mask, compound_mask, buffer->scan_mask, - indio_dev->masklength); + masklength); scan_timestamp |= buffer->scan_timestamp; } if (insert_buffer) { bitmap_or(compound_mask, compound_mask, - insert_buffer->scan_mask, indio_dev->masklength); + insert_buffer->scan_mask, masklength); scan_timestamp |= insert_buffer->scan_timestamp; } if (indio_dev->available_scan_masks) { scan_mask = iio_scan_mask_match(indio_dev->available_scan_masks, - indio_dev->masklength, - compound_mask, + masklength, compound_mask, strict_scanmask); bitmap_free(compound_mask); if (!scan_mask) @@ -1005,6 +1004,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer, static int iio_buffer_update_demux(struct iio_dev *indio_dev, struct iio_buffer *buffer) { + unsigned int masklength = iio_get_masklength(indio_dev); int ret, in_ind = -1, out_ind, length; unsigned int in_loc = 0, out_loc = 0; struct iio_demux_table *p = NULL; @@ -1016,17 +1016,13 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, /* First work out which scan mode we will actually have */ if (bitmap_equal(indio_dev->active_scan_mask, - buffer->scan_mask, - indio_dev->masklength)) + buffer->scan_mask, masklength)) return 0; /* Now we have the two masks, work from least sig and build up sizes */ - for_each_set_bit(out_ind, - buffer->scan_mask, - indio_dev->masklength) { + for_each_set_bit(out_ind, buffer->scan_mask, masklength) { in_ind = find_next_bit(indio_dev->active_scan_mask, - indio_dev->masklength, - in_ind + 1); + masklength, in_ind + 1); while (in_ind != out_ind) { ret = iio_storage_bytes_for_si(indio_dev, in_ind); if (ret < 0) @@ -1036,8 +1032,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, /* Make sure we are aligned */ in_loc = roundup(in_loc, length) + length; in_ind = find_next_bit(indio_dev->active_scan_mask, - indio_dev->masklength, - in_ind + 1); + masklength, in_ind + 1); } ret = iio_storage_bytes_for_si(indio_dev, in_ind); if (ret < 0) @@ -1646,6 +1641,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, int index) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + unsigned int masklength = iio_get_masklength(indio_dev); struct iio_dev_attr *p; const struct iio_dev_attr *id_attr; struct attribute **attr; @@ -1708,8 +1704,8 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, iio_dev_opaque->scan_index_timestamp = channels[i].scan_index; } - if (indio_dev->masklength && !buffer->scan_mask) { - buffer->scan_mask = bitmap_zalloc(indio_dev->masklength, + if (masklength && !buffer->scan_mask) { + buffer->scan_mask = bitmap_zalloc(masklength, GFP_KERNEL); if (!buffer->scan_mask) { ret = -ENOMEM; @@ -1879,7 +1875,7 @@ void iio_buffers_free_sysfs_and_mask(struct iio_dev *indio_dev) bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, const unsigned long *mask) { - return bitmap_weight(mask, indio_dev->masklength) == 1; + return bitmap_weight(mask, iio_get_masklength(indio_dev)) == 1; } EXPORT_SYMBOL_GPL(iio_validate_scan_mask_onehot); From patchwork Tue Jul 2 16:02:36 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: 13720009 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 575C9C3065C for ; Tue, 2 Jul 2024 16:03:26 +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=y+nn5+UgAXp76eW8KBwQQOjjjcycB6/aGSbu/KKNCIc=; b=wyrwypyK2g+QFPxJ8rlGdsczXP Hb8cp2FX6FoUZ3ZSyFR5uK2G33ZgkRONzR601bt5LPTzabpbom8EUPa66JngPUuZb6direLu855MX tDPbyNy+jozdzMFI0/LmqdxnpdVpWcdi7U+LwkQV+D5Hy0WjCkiT+C/XSKl2gADEl7knTiu5eL7go 87KiZMJA+7QZ2KgOkjsKwFCnmwywBIET6bgSqmiRi4DMEnB0zTIEPgFgXmLcoNquHc5peBRKQvDmU kpWD+9BEFXoorlp+FeFCsF5txhyO7GLbK6DqDI/CTPC/hdPIvDHkbqHlz/bnvvYJCAM/wFoqZFN8N vExm8Iyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfyJ-00000007IYE-2wJm; Tue, 02 Jul 2024 16:03:11 +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 1sOfxo-00000007IOG-2l8b for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BFCB361E8C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 370B5C4AF10; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=RaueGeC+jGBMTdCacPR+kb1XmqOFJE7ZrTneACLbmpE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HifFKV1f7zIRt7LFHBSCXcJcLG+fe6E6yersqY97MhQZ6J+yYfDjvnkDyhIoSnsvX huT0ZuavwxfIjRt/sN0PZnTsV0L9Ln80VyMiz3Amw4lq6VUufCYFVqy+Mxcah9OLYd IhNpEF86n6MQhcnzPPeLgk3fPYKsfdSA+9HxrLgTtPgNfX9JgIHD/BAR1IMUGbz7kJ SHmEqbxZ6pDVp1R+kAJeC8FY8HOHr0qo4rVAe5TOdf9zshDh34k6aHIvrnQPzcUlij 500wsqGBIcxhS/4IdvlwIl08Jb6WGclESK6hdbtSMIhyx4hBsR+E6/1C4AEIL8Qp4/ YkBkTHm/Wc2rg== 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 2E6EDC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:36 +0200 Subject: [PATCH 04/20] iio: accel: adxl367: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-4-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=1719936156; l=721; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=f4PVshteDVZAwqATinUZmA3UwIta66xyxWFMtEAfYQg=; b=1jd1tko8JTt6ombBnrwWcAZplN7C74Nu1r8Ua45+V5Zh5KiUAiJVG3T2zgTbf3ehU5XCQW62l Tn8hVu93D49Apu1X0TW0t5tEspUjaokc84rDXaGMUk7V4hl1ov/rbc4 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_090240_798896_193F4A48 X-CRM114-Status: GOOD ( 11.70 ) 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_get_masklength() to access '.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/accel/adxl367.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c index 5cf4828a5eb5..1c046e96aef9 100644 --- a/drivers/iio/accel/adxl367.c +++ b/drivers/iio/accel/adxl367.c @@ -1220,7 +1220,7 @@ static int adxl367_update_scan_mode(struct iio_dev *indio_dev, return ret; st->fifo_set_size = bitmap_weight(active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); return 0; } From patchwork Tue Jul 2 16:02:37 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: 13720019 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 13891C3065C for ; Tue, 2 Jul 2024 16:04:57 +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=+f4hipHhNJpEqRFkHQGUIyYpxWyag47WG0RfBrmwcHg=; b=hnyI0surVt9I4uXX10o1FdDhdB WJ/sCoQskPXsvZDy8W5wo4vBQ9Tcv7Z6yAU9/ZllL3JBuj5erEwQCTU/4AUE3I/wmaC0AFzO2bhzt gWIVrVa930NAjpfs0EDA/yOVdIP/XtNX1i7AyAFBZwUiuqpwaHoALsDIQMxCwj9sZmnVLrm/0QsNJ MX61kMzqmCNwGZSmnWH89K+BNc/mOEGRMUOxq9oChVG38LhsEaS7RJICl75DAKrE7gjjgO6Ew8gRB ian0QAf01XW+QSQH6En8aBtuPCPMer+en3x4EwynXbWr+DJAunQ6FrQVmIcTbFBtQiSkj7XFcS8Vh qt3pURCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzp-00000007JBA-0KzX; Tue, 02 Jul 2024 16:04:45 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IPT-1qhm for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 969E6CE1D8F; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 4D2DEC4AF11; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=P006j2vq5FFKg/037/BLpRC4GtOGeEzgy0ToSf1ZAxA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gIsEo9glS+gXg1z7maaeNX+13nZHc61CxOwODQT7E12lj9txYWFqDf4icUQTQfKNr 2vvGxo4eVCB6pEVmpZY99BHF4MyvARBKhQUglcCT5gcW6U7t4nkRgPTiqhwip4rkx3 y7BywhA4gN3G9Zw9LzufTORjfveze6vrK0OVhnxVAX4uQAZCU5+EP7nPjattNdlOjh UXniKAg6FRHOpVaT0IXYUN+fFS9464JWlM6zML6qIMjl3eqvpwnFHpk/XRt6N2s9fL mfSh6NbsE3TvjtpuINAXxLNK6oAAkOl0fyQOxGIocvFrX+ld2+l2oojYDxE6N9vEma BccjmyXUmYC5Q== 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 3FA36C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:37 +0200 Subject: [PATCH 05/20] iio: accel: adx1372: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-5-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=1719936156; l=915; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=2EHdpJoQbj+k3J/CWxWS22/x7Zsq5ayA38mR5vpDteM=; b=HqGJD3hvrnZvHwYeCHrVGiJTDHQ7E6p+zcjNhkmu9gmiIdn8ADUJohk+uNH00HrlnzDF3XAXL +0ew+gitwztA3oLuTgEsLnowhzmOXwPzxz0T+g+HI0QTHeOapeqk/uh 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_090242_795406_D2AF4C51 X-CRM114-Status: GOOD ( 11.86 ) 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_get_masklength() to access '.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/accel/adxl372.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c index c4193286eb05..ef8dd557877b 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -1050,7 +1050,7 @@ static int adxl372_buffer_postenable(struct iio_dev *indio_dev) st->fifo_format = adxl372_axis_lookup_table[i].fifo_format; st->fifo_axis_mask = adxl372_axis_lookup_table[i].bits; st->fifo_set_size = bitmap_weight(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); /* Configure the FIFO to store sets of impact event peak. */ if (st->peak_fifo_mode_en) { From patchwork Tue Jul 2 16:02:38 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: 13720010 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 B9DA0C30658 for ; Tue, 2 Jul 2024 16:03:32 +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=JGkIDT36ldvVxrbmIBBH43FMWDNpIql5/GkevqBfutE=; b=DlkDXhYvAFEKI2bUu7crQ1PkL7 BNrhmKsJr0Q2VXMoiCqyShM4aCngQxmvzNPfbhrTFyCNlRBZ/IEMDgSuDm8lp/UF+yONE1FyZ1Jur 5oGxcHRuVcZAl/HEdxI2fcpUzSBcE0SQ93FIxKC7nWVtICdi5/WQUOyaYq1fQoCFTBpqh8v9mllh+ VmLmyJS+iDTDcBY990n5UVAFMsuVXat/jgwYK88xv1V5sHv+WdaEl+dy2cyKfCzO2p9zmDfHURAqY 9GNKaPEL3zinQLDTjCn+0jURMQMK2/NgZOrQ8Zqn3D3bh1qTO5Nww5hCO/LLeS0PyzO88R7b15FDc KHPNv1xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfyS-00000007Ib2-2B9Z; Tue, 02 Jul 2024 16:03:20 +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 1sOfxo-00000007IOJ-3G1D for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 180EC61E64; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 56C86C4AF13; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=xVxyFNnUOQfVYMK63TbRRb8qAbFJCDubROXQiuFnah4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZQZWwVx2YXn5Syk2PbUyJCw75rbwjjtC4lW3XJX5qh4WdtutMDDht2L2tTXeo6Nv1 DtRXewhesrqNKXOf6l7+Rt4sxv2qCzHVuTrOunueV4EGPHuG+tLC6UB/odygk7+Cv+ 6P1PtQ55FhyVD8fopiuaUXmmzxOGfxH/lQC+kQOMNMGJlffzsMWOG+nCsE3BEgGTbL xcFBhjf8jZ7ZLBSInPdpKP5m1NaZYeTzUKUkaMSSfS1KSQoF48Q+kPJlWFnMnwh55A mIIuDjY3al+roxjtn3Ey9DwzG9zpLAM4lPruROiBv2yXIARR1f6raLAVf6jTnepp6j P9qxKJ8SJpQxg== 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 4E1ACC3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:38 +0200 Subject: [PATCH 06/20] iio: accel: bma180: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-6-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=1719936156; l=852; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=cf8nH+C7ga2MXuJGs1LhW+Vpw2HhW0TtDxm5BRQV7AE=; b=uqji2JCwXdfwSMPdRVcuAb/d2Dl34B6/KSFtjmrqUxMgkRWE3YlbPtvfqbNr5hbh197ihNyIa +mYYUYZi9KLAkXqmYe/W6FDoDUOXPleO9cilkhT4a4DzC44FcRaDbeh 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_090240_924567_26C56E4E X-CRM114-Status: GOOD ( 11.39 ) 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/accel/bma180.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 6581772cb0c46..2445a0f7bc2ba 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -876,8 +876,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p) mutex_lock(&data->mutex); - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = bma180_get_data_reg(data, bit); if (ret < 0) { mutex_unlock(&data->mutex); From patchwork Tue Jul 2 16:02:39 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: 13720008 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 55644C30658 for ; Tue, 2 Jul 2024 16:03:14 +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=HF1OFAq7oTABoMSf6XtFZDaseS59km2/VizdLm8wpAU=; b=glhRn7tF/am7xIUZ4Ns2bsI4Af +gkVpU0WHX9UOd/+VMf9hw/krrbTZ62HwmQtR1EJCFwB81mcxykLlfD1Kmkoe8gPQYOIPg464exni jr1ph3fqNUdQ/84VIWaw08GnnmEroBlMk/wiCxf31yxqV5hBFKe/jH3e//L0gnhvszhZQNal2WDwU nnFJbhRfdJGGogOy6vAFXmgFDG/rWc2wQBk01hE30uFxW647046BQd0CS/XTBdEzUTcuUgetS02+W ELew1st+woPB98YpqwCZfbVUZ1qG4Ph5xs6lyymTv0KsMhp4f2ElrcUfhC73hVfifhYdkM/ncTQmF KxMveKTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfyA-00000007IWO-2s9o; Tue, 02 Jul 2024 16:03:02 +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 1sOfxo-00000007IOI-2j3R for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1810961E9E; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 62CE6C4AF15; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=HiXT5JNAR/1VnVUe+f4ZpB2y/EtlWF8H9g7WziIDIOk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=g9zkoQwcrhJCIJbGkZ2UnJ2K6vM5cQ5NT1hwVFH1T4YYHPFWPhGrxMtZgOvxipKzv B4ufyTGUezxkTuIpeBcVrkUZGo9FF1gtu9MZLH0V+wLhze+SI8uP8HyBkfEPanA5wb qayOlb/pZ+qRxMK/WGRwSqgCgY7QRfpKF5seY+ozhwqndUjCQuVO/ewSbceCQLMS/O bvAYkEuoXob1XiWpzWLKzXBBVidgSR7eOJVq9xqVx33/WuCkOsj2eDJ9raqT4iOOCb l/O2CVbYXpwqgKlnA0XHL3+PafonA+nvnnHn8FQlJQ47/QJdzPQFfv/fDwTbUOj2BS 8WqN/hV0oyszg== 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 5B51DC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:39 +0200 Subject: [PATCH 07/20] iio: accel: bmc150-accel-core: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-7-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=1719936156; l=922; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=JeCIOP4qgOR1Vu/Iu0Qe9nBtR5DIWcMVPhJ4pTpIOtQ=; b=/2w5q3UWgYNzczpKhdhjLtwr+/NVWDbhJ9/6z6VmYIYt6PsaG52LAInaeclbeVx47gtB/KIA7 Fg5QC9lLSHnDagmgywq6G+tpSSB5XobU6izlnRNijyC3zDtfltQ7gVV 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_090240_790491_33588532 X-CRM114-Status: GOOD ( 10.96 ) 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/accel/bmc150-accel-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index ae0cd48a3e293..03121d020470e 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1007,8 +1007,7 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev, int j, bit; j = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) + iio_for_each_active_channel(indio_dev, bit) memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], sizeof(data->scan.channels[0])); From patchwork Tue Jul 2 16:02:40 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: 13720011 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 D69C4C3065C for ; Tue, 2 Jul 2024 16:03:43 +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=KcuCRgbjmGEhCljCafB97a4uASbRBnwvXCL/sJSdUUA=; b=Ro/Vl8oDQ0HgrYZO6jHOc1g0B/ 8rhQ9rFlurPi75/gDYy0vqVm5ahtmSkVvKPmRrgklk+qjnArNW2vcFuGuHoQoa6c4vv21RcFUw+iu DPzsH3yOitZF8MxNt7kTmDYj7+Zafwcl0ElPt50Zzev03M7RM+SVGVKFwsmXy/WbKzlGsNqN7r7Ry 9/ALwqZ7Y42PxkhW8XGIq1q4uhAGkpspTFmp0Wd8b+s4r7IVAW8kkvsxD7actf5N3tE4esWaIK3AP j8IAtxlOIJTam2XrF+0P+3c3WX33Ww9khQyJ63/nYJqWUqeY6duhKZzCZjokpLarDcirS2Rq944Xm +khaDOqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfyb-00000007IeP-27sf; Tue, 02 Jul 2024 16:03:29 +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 1sOfxo-00000007IOL-3Gtl for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2350A61E9D; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 70445C4AF17; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=ZCwedfbQM7Bvz4eB/mWdYfk3xL/2GllIWFfaCMXiRTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GTa+Vub03zR2Z0JlaAuGVCX8zdkoTQI1fTWcZdCMahH6ij6zkAILRy+47B8/Gb0Ei +b/W+lNoDN3QapbENksnfctH0DMKvBteZhop3lqhhVsI5aEvPSN8KW4KLPxPXoP5Ne /n4N/0Nrf5BiFx0/uet82tEJuef2tAfKSJevMbz2CtLzxXJYAgr7sfQYxdOTb95MgJ lgGX6a3+66yQXpDP8Su8JmajILcpIvgjGpfemIq4gZxiEY0Qhmiah1yz6/ZR3bxE7Q gP72YhD18aXHpI6BKFg1WdziZDsEG8kQuulAg2p59k0HU0ot/M0t6r5g1lPwuu+TEP v8+zYd9wJflMg== 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 6A412C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:40 +0200 Subject: [PATCH 08/20] iio: accel: cros_ec_accel_legacy: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-8-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=1719936156; l=856; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=Yooi1Y6tJJguy67GjA7GqDAjdHAGHhdREsMY2f86Dxo=; b=RBZcE+cYo3blVA2VGyLaJwUXflDQ6pPjo9mW6HflNYlGIxZLsMd2KyTAefDtDCYuqFOtd5yT7 dRU0tYawuD3DUTmtGjIR9BLFCxRsRdf/aghHELirnJcWyKom2CvKcEO 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_090240_915135_B5856ACC X-CRM114-Status: GOOD ( 11.37 ) 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 Ue iio_get_masklength() to access '.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/accel/cros_ec_accel_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c b/drivers/iio/accel/cros_ec_accel_legacy.c index 0f403342b1fc..f7e4dc02b34d 100644 --- a/drivers/iio/accel/cros_ec_accel_legacy.c +++ b/drivers/iio/accel/cros_ec_accel_legacy.c @@ -62,7 +62,7 @@ static int cros_ec_accel_legacy_read_cmd(struct iio_dev *indio_dev, return ret; } - for_each_set_bit(i, &scan_mask, indio_dev->masklength) { + for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) { *data = st->resp->dump.sensor[sensor_num].data[i] * st->sign[i]; data++; From patchwork Tue Jul 2 16:02:41 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: 13720014 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 A24ADC3065C for ; Tue, 2 Jul 2024 16:04:08 +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=iX15k1auQ0rzPVN6d0CQGgYSuNcrqz2ofHlHX1nH6dE=; b=ervwqTxbw3WuXhOZCJn4Uf6nUQ CW86Ckf95NOQ+AXn2nO59g6wWnyFZ8d3aDqEMvgEOqIbUp5S4ioIciA8MUkOeri/waodr0RLLMMka PF2jGjv5jfF5YK2665Lpw/SPMm7uYYFp7J4fNuZZBKzcAWdUunL+wk+G8nJ/AjI3hSn84Ou6KdTVZ dErwNyIBAEx7e56rK4xKmLr7oxtXPbF8xTQb2/pzzLBp9DBUvtVOpJoubOQ9oPFUy3JL4g0Z8flAE lxCAM43aJNrCC+36A8fFiaJM15Mensu3GgPcOkbcdNtAYrMJNJF49zI752SWxxofN/qQur3hpaNde rcYEYwxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfz3-00000007Ir4-3Sqn; Tue, 02 Jul 2024 16:03:57 +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 1sOfxq-00000007IPf-1YCk for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 28E1061E9F; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 8729FC4AF0E; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=keSrboDdnEDk+BOxBBWN9hfl5VamPSjisDY1VWOq4Ew=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=SsV9sKspSexexI2F7IzaVFT8w//xU7W4Mv40yapmj4TvLS6iwz1xktAqRlhinQmF8 Yr+CGSRkpzMqrGJwugTeiKCKvctiBPdGjsiFOp1a9opSjpbbh2qp8ERNUjpcNhzthK jrD7uxA2XDaCGcdZRoxQG90v36z1n3RuGsvgs63MybgxQ5Da44EwBvX9ixDBHjowTV rYO0yvI0WhBa7/GsDKB8FlyeuRAWfHi7IYlxJAPiCN4oAdRs3ql7h2s2dS35KHO8XL U3kw4rAxWW198KiPxkEBNOcHShJacSs5ZAEY0oz+tUgM1/rpdAPhCwCpkbZEmjXhEq VMj0OKE4Uhu4Q== 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 7B0D7C3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:41 +0200 Subject: [PATCH 09/20] iio: accel: fxls8962af-core: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-9-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=1719936156; l=913; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=4mWpFN+edUepEAApNSzBRyHgoD70Vxqq6Y9OZGqmjrU=; b=Q5tLlYPDxHAbfMtvcRj971Vl0lxoxT3px4ZQXt19F8RlGGCkWemotJzujrMz5YE5MM54lGnKB JgnHzH/TqZuBQ0hxTLS1Ohr7dDn4xnXlVSx928Bol5OMxW2lV0tR0Cf 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_090242_525630_00611608 X-CRM114-Status: GOOD ( 11.31 ) 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/accel/fxls8962af-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 4fbc01bda62e4..7adb8937cb4b6 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -968,8 +968,7 @@ static int fxls8962af_fifo_flush(struct iio_dev *indio_dev) int j, bit; j = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], sizeof(data->scan.channels[0])); } From patchwork Tue Jul 2 16:02:42 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: 13720020 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 05551C30658 for ; Tue, 2 Jul 2024 16:05:06 +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=p3jRmRGCfLRE4rNT9cwPaDdKQ7PUOFPcZKoA2pqHbLo=; b=hrx2OFqmsla0HUakwSG/SnmxEW GIdv6RL7rblINag362F0qInhy4SYPvk8IqWZRGCDuIVlrtKx37ucF8cWiIBG94S48CUWw4um3OHY5 LYjH/RsmFG/d/itMUFPOCEgjOfSJL9ZvHLTK31YKqG/31t1ORwUYqBHMa/GHIgoyWR//1kMqSrCC0 Ml7eCVXDmMWUfvAkFBVqqSq4lhkmr5wikHxsHzXEhjlOFMZCBPRCydLJ0zN8faacSFZS7jZ7p3Wfz I8maqLAZ5XOEWYDGeQXYDZuwWf0qr58MgQOjLgufGUyvhogD7HZRQ5NaP6TG2KbRAU9qGBE9TcCB9 TKdLOIXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzy-00000007JFY-0BvM; Tue, 02 Jul 2024 16:04:54 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IPU-3gc7 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 sin.source.kernel.org (Postfix) with ESMTP id C63D4CE1DBC; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 92100C4AF1B; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=sC6ETYZGhKeNPuj0zZiWjODno6oDUaoxrOkaAN4705Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dRqPCCHRXxodNkirSyOOro7wnrfW9Cd2oxcptRRDGYzWwHZrj/GxHKtC1QYotZ13x kfCP16V1+eTE2GgppDVcvy9l4uq4O1uqsrCit3R4okjYrXLjhdbGtwSnUZF7ceU+5E wKzw5dTF80AB5JNR1FC8cYcJqyT3kcMatIIhqsWedNyKtvUEq+kDvxBJLj4A+4C3SP TVK0DH80SsHh3CznrpbHDSBCs+CtOomIx/pgrZLHDWuTLGzb9XBbWWrYX8/DlDr1qb L/hQb49CUsyDX1OkheSkpTy9LCK0xD2t/MbPfnrnm09pPApC7XHaaAnbpcelFkauhN zOgsjgGJsHhcw== 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 89E21C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:42 +0200 Subject: [PATCH 10/20] iio: accel: msa311: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-10-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=1719936156; l=842; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=mlp145cykZFgcq0ksMJ0dMmg1Uqt+N31aaJsB4Dxu1A=; b=RKVvBr9oHa9ZYzfP7hszfF91tCbZHswMxdKBVlu19N9CRk3yM7Us+aLt5RvpjWY5oylhPI2U5 Q4H4Fy7vETTAd564DZvXYO/AfA1Si4c12ORmJ+On4w5TqjqX1htJQgN 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_311110_67AB2D88 X-CRM114-Status: GOOD ( 11.16 ) 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/accel/msa311.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c index b8ddbfd98f112..8861010256f2e 100644 --- a/drivers/iio/accel/msa311.c +++ b/drivers/iio/accel/msa311.c @@ -900,8 +900,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p) mutex_lock(&msa311->lock); - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { chan = &msa311_channels[bit]; err = msa311_get_axis(msa311, chan, &axis); From patchwork Tue Jul 2 16:02:43 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: 13720027 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 558F1C30658 for ; Tue, 2 Jul 2024 16:06:19 +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=LyjgZIJKg52ZZOd3Fh3MgZLEgsDapiFHcTDIBgpgCsI=; b=SG8KWuHCpd0DKsek00V37ryjr4 +p9Me519LUK67DNIb1KhOvzqAHn0w0KGl0B6Xjid4RlZNG9ZBafpwj/NWRqIiDkFRyuKGl4VrWqNO v71PtNnMyoJVCXHvAn99MJQ7TPlk7f3ehY0rPwc0gYPKBviOws7B93fo7z93BiuXKnKIx4TGqrgA6 luKRPkUujWVUQ3Q3PPK8gKOqFi+aWTs13EI0ohNOs8jxAHPIHF8+dnfNrZQtb1OH2qZMrYA+DecVT B9PlGDUe2saZCWcD582cWEfZa2uX9u2/oywnRyZEFjF3TRhT+vWJC6piKyNVoESd1jBm4JwyUKoS4 9GUeqA3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg17-00000007JqS-20P5; Tue, 02 Jul 2024 16:06:05 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxt-00000007ITB-2bhV for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C65B9CE1DDA; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id A0B7EC4AF48; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=uO8h95Raq2yO1cXDpXi+1Lxc+3OeSQ09Wa5SZdi33oY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FHzyyNCHLBPRBrODchSbYz9J4OsDNnnhjiHTghKk5VyvmMTjJ5ywqMLa5g0uyCqrQ ipDEU9RkEXfKLqDBRD9jDCYKQVpAMHMUeF6vA2DbNpFtw14fH0V73NFh4F/0Db3Q7r xjamZAewyLP7mS1uqZKc1chUrblF+7Al941uB7Tnep5teG7zOc+V5u45Uk1wSsxrqw zaB0JRwTZwj6Ahlmj4Hxub3eAzCxKEXXPwudOPJ86PpoJnb/bT2GhmVQADpWsK28TN YbLMY2D3uNoYWHLJB9+629xNRMZaSM8HHV/eVJEKSHlci/e6AD2xjRLv5C+KjAnoPt V2T3nf2RsmpIw== 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 99228C3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:43 +0200 Subject: [PATCH 11/20] iio: accel: sca3300: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-11-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=930; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=NiKRjo63/+CijDcg34TeX86O2hQZxnlYkTzG1tnolLM=; b=jPnvlGu2A4lqfgW/FRAGVpZf3vAhpuc2SU3/FBNHyOU5fX8sYsPlhAeFv8kmHbE6KA5zkQ2+E mO5j0bhHf2OBadPDqmAb8uiWfq07u9LfBK0TjgkXcnZpPv23KfZLwka 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_090245_990096_070C3EEE X-CRM114-Status: GOOD ( 11.30 ) 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/accel/sca3300.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c index 306482b70fad..fca77d660625 100644 --- a/drivers/iio/accel/sca3300.c +++ b/drivers/iio/accel/sca3300.c @@ -494,8 +494,7 @@ static irqreturn_t sca3300_trigger_handler(int irq, void *p) int bit, ret, val, i = 0; s16 *channels = (s16 *)data->buffer; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = sca3300_read_reg(data, indio_dev->channels[bit].address, &val); if (ret) { dev_err_ratelimited(&data->spi->dev, From patchwork Tue Jul 2 16:02:44 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: 13720015 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 35E28C3065C for ; Tue, 2 Jul 2024 16:04:21 +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=xB2xjbSpU7XEYdHl6L3bbFmCTTO71/WM4FMkHgYEXP0=; b=lHklP5oEADgyCZBxfHkKr1AOfQ gKHXytgbJRFh41iX7N4CipndQGdb/TV4VOVHFeiWPeARgq2/Hu3rzI5QWKM0w/jmfX6T4UczkT8n1 QuMvIPC1IWCevGaDOfBKc/1/1+Xp66bs5vabdwuo3dAodIsZ8KgA10D/pC3RJrIWI7sHaIKW9naiZ Ni953TD/dxBwFwdYzNA4uZlcAH6fUccTZj5VIUdzzDs9z83xG4NUQGiGRVt8SlxDzz5eyiblenK3/ U7KNu7z7Z2+2u9i4XxcCKSOcvl5rvksD20nvV8LHLurE2y/Rd4yj8WTkXOq08kWSYuwKq+S7bTzMM DpaVVcsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzC-00000007Iv1-3COz; Tue, 02 Jul 2024 16:04:06 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IPg-2nbq for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4A5A661EA3; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B15FAC4AF49; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=nfHKW/AF9PYmMiW+5wqrALl73lz8upCgwUkKe9Zapb4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=G0o+Ko7sCr/Bm31UASvWzzwCMb6bUFhhwsXt7sRKF9fryxK4hziSjxJIjkxXX8qEE xuqd0E0ifjZheGTea4byqsLfOgZ2+3AUDXvSBvMLSbbqN6J087iHjRCoaN4ES0c0st 07WPwg7FiMV8aeiDqSPIAS8GKGRU7PXsOyuvWIREH/f4hiPgO2nWB1utwGUM+msCiM nmxsRUDvPW0iZM3ltJNxIxFp1SS6PUiuYb2UVFy4GDNLrW7Vq6jNTyvG305tLesL4m /h7ZEOfAsmMGRbdR5+FgyFcG9q3+T2rGAQi0egim/i6PRyZgCeemVHkkjRgj4Vw8GN nIQWTQZHDY3KQ== 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 A6AF8C3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:44 +0200 Subject: [PATCH 12/20] iio: accel: stk8312: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-12-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=860; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=sKvcghE5ThQXXY6IqazRh2jRyFRk4Gvhw2Dt6y9Vhp8=; b=kt0rMyqWMfymAI/q/Z0mnVnvXvK3GnHs++rHvCcBHM46WfZB++w555wevU7tgbbCqcgTdmB6j DpFqKVZfwP0AkzerK5hCIynsQ4wo/L0jH99Mjn/zsRlGOE0exxAh4Ko 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_090242_934464_9E35C3BC X-CRM114-Status: GOOD ( 11.84 ) 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/accel/stk8312.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index b3534d5751b95..abead190254b5 100644 --- a/drivers/iio/accel/stk8312.c +++ b/drivers/iio/accel/stk8312.c @@ -448,8 +448,7 @@ static irqreturn_t stk8312_trigger_handler(int irq, void *p) goto err; } } else { - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = stk8312_read_accel(data, bit); if (ret < 0) { mutex_unlock(&data->lock); From patchwork Tue Jul 2 16:02:45 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: 13720018 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 01497C30658 for ; Tue, 2 Jul 2024 16:04:46 +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=OBC5NCqNQWTXbq0aYffdCKLGIh/sY+zd14jkmXDUUC0=; b=e5SOphA7Wgf5LKoLbyswzEfknP JHF6Rp3i+qAywaOH4Fqn4EDgvuuhL3OBYRGKkmepQ4znvQIabgyCNqJVRqU8cKpo3q4mBytSHmZru bFROpgNUIoUB1KcEpTqeEqns99GYWSrJSLipjURNEN5TSge/8tsTpkwiB6ecIMN/Zm6toGqY436jt ZxXG132x0/1zfWFmgaGATgbldc7AcWn087hHuXfkiSn+F6rF3/2JefGh52ClZWRieN2zhjMa4Ti5J CsFGUv7BTW81mkJDR2MCPxLCLC2atQUxsGb2C95MbTSHVB1EV9KPXwJqujFhHphmYlKTm3Dovdm7c VdlgF+LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzg-00000007J7f-0cAM; Tue, 02 Jul 2024 16:04:36 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IQ7-4AJh for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5224061EA7; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id BB7F6C4AF52; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=rd4bK4dYxKBbRt1v/HZMzCwZJy2bdmq2nBBb4Aozq18=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ijd0h4VGLKb6DgMe5DsdLxpkH3LbYrWs2NMHmaMDaNc6tVzkfMo9kUEP2wJrGsGc0 Od7mnwaGsqanwApfirV7x/qjlneE7P8aP8x1Fm9ophsegSrP7eYvJeoEmLudFDhu46 5R38H33cLnWvK208CK2BHc4GkhONUHJX4aQbCMLiLThgjBSM5TJYJre3tyY7jsOzgo S1obIwoNgFve0lCmS687q8eUNCie0rtx1xkEJJyRc+1vkcSDb6gnoJQItwX3u3YQ/A EnGb3s543oao/IsJDJYO5n3x1OEVycMYz6kD3CqdQtazs+Ngbr9+BihmUOH1XShqe4 vbc3YABjmuVpg== 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 B4516C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:45 +0200 Subject: [PATCH 13/20] iio: accel: stk8ba50: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-13-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=866; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=TFHhQ83QqdJS9zWdzKNj08+dSBp1rdr6hB/g9TIyego=; b=vHiGPKXd69rf0HoQ0INFT45P7M/hmXLo0wVQ4CVhuTDIKz0/OPtTpUelGoQ5YexRkZHIpbO2c 3ZzhIyVx1UQBU3qUZQf0pojqjpQ5CeCmKRq2Aah3AUVM5WwC0Yayj7w 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_280353_1D2372BB X-CRM114-Status: GOOD ( 11.72 ) 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/accel/stk8ba50.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c index 6d3c7f444d21d..a32a77324e92d 100644 --- a/drivers/iio/accel/stk8ba50.c +++ b/drivers/iio/accel/stk8ba50.c @@ -330,8 +330,7 @@ static irqreturn_t stk8ba50_trigger_handler(int irq, void *p) goto err; } } else { - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = stk8ba50_read_accel(data, stk8ba50_channel_table[bit]); if (ret < 0) From patchwork Tue Jul 2 16:02:46 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: 13720017 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 748CBC30658 for ; Tue, 2 Jul 2024 16:04:43 +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=+yofI+IC4JFd2MYDTAaPYsrGE+zLYCvfzbdXfXD6ktE=; b=pDI5khxHESVjbccSawEU7db9MB MT1z0m30PeHAymPsoIPOBXqWaZHMujc4eIok17U7QnDajakudzViYLYqEiZEd8IrmBn8QKBAWd9oY 3/DTJWWOu8t9uR6HirwtW7PeUzcFjQ4U1Sf8vjZeUiBW1IJl35498pQwL5buPPg9T/4n+mW6sEj1o MZ40/azTLfFWoWXcexCa2vf9ynGn//SvPma/fnyczteBYbvxekT68UjupPQJQA3Ym74sj6sigBe0T dtc41Qvgh/heLDcdrlM4Z4vojVtuvf9iEetiydd61QmStW9GWwC8T0KEbD/yGgleNmgVDfXospkZC avvF8+sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfzX-00000007J4Q-0JtO; Tue, 02 Jul 2024 16:04:27 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOfxq-00000007IQ6-47Gp for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5D16561EA9; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id CAB6AC4AF55; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=5Sqf3gwvJub0vRMW4cTH/hkIJm7o6yILPfaLsjTjjWM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KhUiOTLUnQZcDD+FUIM+JKIGCq2LQ0g8oiC9q5+/cC0EkFoms0MuznBS9mF6wqt/R e+mvXEpIbxbJuGGAVReEOu/RsIeICHwUIc2BDL0lXUCnzlc+aWLU2kX/29bncr2yhl 2dxvT3WaqIUui4R1TpecknVqAmY96yNph3mgTJRDlFO5YUwwq4RNMV1mmYGCFUsLPA K7t00u6NyC1jrZYo25s3qRAILBXX9TnIlfr4jUdBkoqBfT7beVrNZslbO5FelwDSfr cJntrdS+jRxYmTzroiBP7Yi1n7NHcopX/5csagDuBVbdeUamEBY30308/iwgcmaDgE qvtWahIGo+oLA== 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 BF609C3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:46 +0200 Subject: [PATCH 14/20] iio: adc: ad7266: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-14-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=824; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=+iJJW6/7I7TrYM1u+38IFCTTovEcPX4B9OrELlHsb2g=; b=7l7oJaQgLVUbsFsJZpuh/oP4+s8aNKMFAN7qbsnmyXqXb2eNN2i7UbGgtUnd4IeCXab9ouPGq SZ74x2ZsSvYCRuuQk6YpSeKtcNQz81jnLAy4vhEy2qwwXAOue7kJG3/ 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_268473_897E35A2 X-CRM114-Status: GOOD ( 11.20 ) 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_get_masklength() to access '.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/ad7266.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 874d2dc34f928..accb78d4c3086 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -123,7 +123,8 @@ static int ad7266_update_scan_mode(struct iio_dev *indio_dev, const unsigned long *scan_mask) { struct ad7266_state *st = iio_priv(indio_dev); - unsigned int nr = find_first_bit(scan_mask, indio_dev->masklength); + unsigned int nr = find_first_bit(scan_mask, + iio_get_masklength(indio_dev)); ad7266_select_input(st, nr); From patchwork Tue Jul 2 16:02:47 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: 13720022 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 D210AC30658 for ; Tue, 2 Jul 2024 16:05:24 +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=QZEAj7UvCsmshDzj9F4+h04hWp+OCrkoeU3FbNFZ/ww=; b=BWlasp5puClxi6iN/Uw8vupFcz ZpLnyauAbvpFQNtIkSinmBR1wFf8GXFZaCoYhEbcn4gxbvvUCHHsfeCQxTwN6BFhRZ1MuTrxtqWVf 713seCNCF6hmIAUAEi0/fKS0vhP78Enty+w3cI4DW2Xc8OiTeTmXIhJC1oKw5hhoqouosHozkDr+/ 8P7Bm8/Bb6cQe/B3tcpNvzeyGQmNJRxd21zzh25DS8gtyp7kImjQBedGzm0VzAkJP5KcbJbnA7U+z R/+3OHX3WVGPzoVqyC8XTfnnkSh/uZSQLUDuZcJa33wNYHSPKaAzPQUreBVp1dpLLPUF+QwXTuGke GegPk0ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg0H-00000007JNo-02z6; Tue, 02 Jul 2024 16:05:13 +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-00000007IRR-2mLt 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 958E161EB4; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D9145C4AF12; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=71yuAUOKQP1vw736p1/RjH6fm1/8Q3DuQ5CHUBxzKZM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uW8b/Ltn68boEo6cbtU/0evdtMrP+Lfhbqn1Jn7SXi6rhL9ls7GcKgvHvw3QvFYNE jG3j6iBRiB6ZXav9XPw60Bn97M2BHD5XpHRssmwy/Afx+Gg2NIAFa5Xw6wENcvA6SV COCXWYKNPzCwRPSrcB5EMOVyG20pie+Fi85m0lm4ChyXZ168NYWhXAsKP9b4AtvYOE y81jaxNCJpikWR9ZDgFkSpdfVJsd2PzCor8JVFp7orHvjzsTH+pTHg75BwlLMc2uVJ Bx0rDhVf/2RvBu6b5q2BywM7JpwabuCC1NXcx662sg7V33t36/+z5rQdPxWZ8GPHMZ FvYmMJXLr813w== 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 CDECBC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:47 +0200 Subject: [PATCH 15/20] iio: adc: ad7298: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-15-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=801; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ZK5+aMXYaMNYV9d90opMtFfRkoEJrZPm17fO7HBXKCg=; b=bBdOYmZMjoXy8dHw5U5DCzkC1MW642k0qxtGkPbdxSpudzdrcC1SyHkq1BXJDjzSOQsc2EYqH PKMs/R0+RzqB2zgmUTR43u8A7wBZFCtENhKKATYeu6u68vHJTWB0Imh 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_882035_4346E529 X-CRM114-Status: GOOD ( 11.02 ) 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_get_masklength() to access '.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/ad7298.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index c0430f71f592..0128436367db 100644 --- a/drivers/iio/adc/ad7298.c +++ b/drivers/iio/adc/ad7298.c @@ -109,7 +109,8 @@ static int ad7298_update_scan_mode(struct iio_dev *indio_dev, int scan_count; /* Now compute overall size */ - scan_count = bitmap_weight(active_scan_mask, indio_dev->masklength); + scan_count = bitmap_weight(active_scan_mask, + iio_get_masklength(indio_dev)); command = AD7298_WRITE | st->ext_ref; From patchwork Tue Jul 2 16:02:48 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: 13720023 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 01143C3065C for ; Tue, 2 Jul 2024 16:05:34 +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=hLuaZDUS4vPOGmhXZCTS/i6VY3wATHxBFv8qpN8dMxo=; b=uLptlYehqg2RQlFUbRrrZD10UA D7JJmKpHoRfKSdpcjoZfL52Nfwjh+p6iFKhgzAtnB17IBhIkVffNKoAot11Tf2k7Z2upk5kh+NyQS 5mTKQv0iAUQI4XnO+uyt0W7vzG+xa3a1bhsSe9yvz5zsD8pmYO/CjRo1+A6B0bwmRa+/Sn/z0rZJs WW3eJT132m6D3+MujFzMxI6TwhDAxU7kn5FNxljysKXfSCu79jTyggaEw3s2Bfe/vA+EJ/YL6MYsr ZDMk/QVRFueMD25TI8eLl36cEhW+m+QoE/J1lshHrPTMoaYESzQ47+jft54m6CR4yWR+tlpEmSwY6 OyCoOCYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg0R-00000007JSx-0opu; Tue, 02 Jul 2024 16:05:23 +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-00000007IRx-31hz for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9C55661EB6; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id ECB95C4AF61; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=3C7xNuV7g+Pf5OBq4kNLo3mjBqcMTFSkkJEkXizSXuE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=S4NyZUi3OIU2n/fcHqJiRu1Fy24oXFT9thNvHhOEPPmrLhfLdMTzrflFTI/9z0UPa RMmr5dgV3EzQ6tOZJoPPA9ult14syGC9hwatSRtyXMeKkvDQANnM1ucYTcG6HF5NSW E/0pGhL7Gqcg90n5KCwOe8iWF0UR7qesfJ3zWKvzRVMdAPcy1UgQph5wH8cbAMaDx6 rvKn0/rF7ry7RAZnROpoJRfqBOCHzlOgKv2OBP20v/2VxeQTucT7aXFxTXBF33Lt2E 1/rgVdaid03gB7Fuz8+zliY8ttw90tCe9I5Ft3HZqevPAoi5aupz7xKOAbfx12QGjP /Es8YFDMUDH/g== 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 DE707C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:48 +0200 Subject: [PATCH 16/20] iio: adc: ad799x: make use of iio_get_masklength() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-16-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=791; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=wWndx9yRTDx49TztOjVCAJ5yEItwvGvV8lgnhI1efkk=; b=h45vVL4Ul2B1DhYLqcsnz1Wp/Q8mkB+/gpyHYoVmBZuWoZ1M6bMprsUorUO2yz6D8zWbYsDBz eOPXJHEaY5nDuJuHTISepLyyHz0WZG4h2xB9hbMrT1qh+vX3r4jOBxg 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_090244_008358_91661345 X-CRM114-Status: GOOD ( 11.06 ) 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_get_masklength() to access '.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/ad799x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index 0f0dcd9ca6b60..0f107e3fc2c85 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c @@ -237,7 +237,8 @@ static int ad799x_update_scan_mode(struct iio_dev *indio_dev, if (!st->rx_buf) return -ENOMEM; - st->transfer_size = bitmap_weight(scan_mask, indio_dev->masklength) * 2; + st->transfer_size = bitmap_weight(scan_mask, + iio_get_masklength(indio_dev)) * 2; switch (st->id) { case ad7992: From patchwork Tue Jul 2 16:02:49 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: 13720024 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 A7116C30658 for ; Tue, 2 Jul 2024 16:05:44 +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=dMOOlYfp8QosxRdisUPUFLp2GBKGJCRNa+Nln2O++Ow=; b=MGZioehX8SFbqIip3+O0qqN3Ks gBuAmueW/STvFv1I0yXt3UrfUOiyfPZWP/87vXCXZ47DKrpV/t/KjkcD2s48pWUlLAyUTnQM5S9a6 KPfZApwhKp6UZfIaDu3EBJga3HrNf1nwGOR5p4/45I/MsQVpEYOwuPZm0Ng0uwUd/MNDJuE5YGo7j 3v6rNRw6clpTGZ6IhMGahLSi1k3YJ0moieQNPOdQYJOxnA9U8avfdNlCXx8GEpYQy2ew42A9J1ts0 hyPrFTMey7JJxafgE9ejxqHcXdvOu1QLQ8B4+0pMmrzLbY/QZCwXDlfBRFJOQlqv+g2HES1F9VIBR qr1dytaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg0b-00000007JYh-3aEX; Tue, 02 Jul 2024 16:05:33 +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 1sOfxs-00000007ISR-10jX for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A725161EBB; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 0EE9DC4AF68; 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=fE3JhjjT2bztKbT9EOlEvE1SsTlV+JMoyOGt+QtwuZs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eGYWFwgqqvXg9Bzn41VrH2vawvuQXqsjfcV35VVcEis7XSUtBig618DLuReJejf2G FokgPm69EGEzxUMXruS9khYGzECvWrnul+bogqojcTm4KT7QHQzpuNrZrEnk420Iol 6+1+I8k1GXoyrQAVbOBp8Z59gnYcXBrYaPyDuGYd+6552criqW7CyaMVKKdB6gtyln ZZ1Vn+yU1VmAziug1gH0eguUPtGUm7RM1Or06RlMrjB2m1vTFStMQ+swTNXxLzLvNS Xljzl0UKoZuGh/f3+9XRQkRoHXDzA1qYLp7QRFnvBefCe4SG88v+f0UhHEf7CeW74s 2JvBpPg5jNsZQ== 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 02B68C3065C; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:49 +0200 Subject: [PATCH 17/20] iio: adc: ad_sigma_delta: use new '.masklength' accessors MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-17-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=1684; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=GoBEg3yNYVlK4uhicWAng1ZNnwcbQvwHl3xbhcuNjPI=; b=wH7sHfvZ2g43QU6gZdGIAYHosI3ta6a2Y2rX0bDLPTTZP8YUKYKEsPAHOiPLFkpEy6X8JewNQ inqywiBMXhEAwR5cClPLYIWa1ixv/6XnrnAEBltg4drZ+C/pVbkHVmn 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_090244_479220_61871C7B X-CRM114-Status: GOOD ( 12.63 ) 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 Make use of iio_get_masklength) and iio_for_each_active_channel() to access '.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/ad_sigma_delta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index a2b87f6b7a07..62653d7fe39b 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -350,7 +350,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) if (sigma_delta->num_slots == 1) { channel = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ad_sigma_delta_set_channel(sigma_delta, indio_dev->channels[channel].address); if (ret) @@ -363,7 +363,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) * implementation is mandatory. */ slot = 0; - for_each_set_bit(i, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { sigma_delta->slots[slot] = indio_dev->channels[i].address; slot++; } @@ -525,7 +525,7 @@ static bool ad_sd_validate_scan_mask(struct iio_dev *indio_dev, const unsigned l { struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); - return bitmap_weight(mask, indio_dev->masklength) <= sigma_delta->num_slots; + return bitmap_weight(mask, iio_get_masklength(indio_dev)) <= sigma_delta->num_slots; } static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = { 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++; From patchwork Tue Jul 2 16:02:51 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: 13720026 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 B0C0AC30658 for ; Tue, 2 Jul 2024 16:06:02 +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=dlUEcALQgHmFH8SXR9B2vilP/F+KZw8Wk00vggJyxIQ=; b=P3XxoEPtwz2Piwt9xrOrSECbca pgqa8+be+2WXVQIGQZUrWGQsej6pCMpT+3/f9aFuLP7qajwHiy1R1RDjI7iKPnLSrQ+EeK3ib0oaL ltaQtowspWQOtVrSJkN7qAcrFgQeMiN1HNqnOn2sVvcC87EbI3pobCastMxwuY/EQ36jSCkLVC40e duTel4GSRGzUqIwk1WlYVI3fbip7nZR1Z9LvRBJsk12VKw6yr8EHLocCW7en2v90ca/3UNJfrKRS2 1c5Du4G2r/stVopdO85TgLDMMVDNW7j0D4P8ZPC6YRUKZPqpZfGQmY8v6VJp/nbX9UKVfV7JsiutH dITYwJDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg0l-00000007Jeg-3hJA; Tue, 02 Jul 2024 16:05:43 +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-00000007IS0-3Sxx for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9EB0161EB8; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 3685EC4AF13; 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=mpdIPf2JJyuaQzZPivxG0g8giXcm2FQ29mHR6NwT0Pw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=EpZRbxI0GenslmjeOX8hSVnqDQS+RiaydEx3/92bIxJncMdwv9pPlh2zHzPoyjc+O u3w6m8Pjw1VyHHk7jZmUFeSx/MJ1iDLGRUF8OnsuzcKY0QPQku1Qj+rKlFvBfaU6l+ dvawAhYyzONpHDnY2jkfp9fN7pSA8KxsmKT/4PGyc2b9ZdNGGAczjRpM8GtNYUYlSR VWtX3Cghj9stii2XErXQBG9czeuazUj7sxqIC7PoG3SbACO3npOqGYJdkN/NHaOD5z 4Vsiv6buPwBEtO46wQZJVhUyaLFS1i9EN7k2jHidPlYwlnQftpdjbxgkQ+sUCp9bmr awc9Gt6lmHiAw== 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 2E58CC3065C; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:51 +0200 Subject: [PATCH 19/20] iio: imu: adis16475: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-19-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=891; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=R0wwlEsuLBVxnsU+A/xQqthiBloXGcKrV9R2Xe/WNOk=; b=ig8hNaFeuY+6AqHCCCLWYv++S5uIRb3T50cfV7rToGdVwa4/sz19fb3vXj3FPvwcRRv4fEkYs ipUbY1hCjTzBb5+pF1iDYBRZBlX4YQe8ZMXCQhzqRwIWF+ie83Ry+8w 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_090244_066123_82B76871 X-CRM114-Status: GOOD ( 12.13 ) 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/imu/adis16475.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index cf73c6f46c79d..1cc2a66a78ff3 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1608,8 +1608,7 @@ static int adis16475_push_single_sample(struct iio_poll_func *pf) return -EINVAL; } - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { /* * When burst mode is used, system flags is the first data * channel in the sequence, but the scan index is 7. From patchwork Tue Jul 2 16:02:52 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: 13720025 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 D01D6C3065C for ; Tue, 2 Jul 2024 16:06:01 +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=frWusUPTpkFiQObXaG64kb4W+4RZg63bg/iiWHScPsk=; b=M6mMdvBzl3g1PUlPZcyIwUrJTR RuZtaOTu14DCi5pH8zVO9Aax2/fOCZcrSZXbAUIlvhF1aKNHawbcZSY2VY0paVhHhx5U0GR2E5n7o E9nmByd93Y1G0HvzSlnkICtfCuOJVEM+xDe9VoFl3z90sdR5VcmSnzz0DZCq0Q6a9S4KiYd2XYw47 uAKYI/KV0OMGHTfc3MMYWJ0gCTNJtFo74QUYd9qZpnvMva5b0rwQAO3DhXj/vxV/fle7uRO6ABvgW 4+IdMpRM30Y4aDzVRzdOaclcQUdnhlz/c43/brWZIdwsDeppuHDvM1U9K+67agxR+JZzYqO1GRt9m 6Y6AbAIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOg0u-00000007Jig-3wAk; Tue, 02 Jul 2024 16:05:52 +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 1sOfxs-00000007ISX-1Jr8 for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 16:02:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AB8B161EB7; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 4797DC4AF17; 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=66crgnursJi2B2eq0VvNe1euuje5cNpdlKdf9yiBQ5Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uX4ybv3a6Z3mfPKeNbWh4RfSjDaMSWtQTyu6nIqPkcR0t8MvIzAuA68/7BFq4G9jO 0PnFuq0vn2f9lwqCmRg5/IDIzw04V62frhAkVbx7HjomWq6ZJ7aqXHyYZO/Hray97v s7ZvaZvm0OQCAOSzFT0BejepkFxud9G79EUbFv7FHwxqplSyj+PWqGJBBVzLSyCz8I dgBxEH8xUZbKaQlAkaQk34EzGwD3mcYDbGizZYOVP5QoEIsIiGXa3Zsbv2TOhwAsUF OyEQ6+SFzxJhg1Qv+JeB2VR1KF0yazmhRG8at74lm4rKYM0kk4B8ge/kRt43B5IY2M 13yV3pq/zovYg== 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 3D814C30658; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:52 +0200 Subject: [PATCH 20/20] iio: imu: adis16480: make use of iio_for_each_active_channel() MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-20-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=884; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=9JQj/jSVCDw6YceIOCpJXsyqqh4Yh0od5ovTl7zFZaw=; b=WbKDEozkTJlTjNGGrlbP8WBXQHbJ9MxM+I/TdvuUkOeC2Du4VJFmRNR/8xcAc92ZixIlu+VhD X8ML6nmxoN0BUGffY3qH5gMINA/SRS1OC/SWA7+oK2DFped747Yb4fc 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_090244_543982_AD899CDC X-CRM114-Status: GOOD ( 13.23 ) 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/imu/adis16480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index 56ca5a09fbbfc..2f08268bd724a 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1410,7 +1410,7 @@ static irqreturn_t adis16480_trigger_handler(int irq, void *p) goto irq_done; } - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { /* * When burst mode is used, temperature is the first data * channel in the sequence, but the temperature scan index