From patchwork Fri Jul 26 08:22:53 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: 13742462 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94C7042A8A; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; cv=none; b=MisDuQkkyjFr2/zGV9C1hxzoImed0IW5MvpgAVx1gUP0a9gJvBCbqMooBh7+2cNNbSqKrDvNZ3Jr3eURECC/W6Z215TSpbF59hPyn9GL3mPDM6NiKdhmyNxyZ6PT1nzKyotq63bo9XeRPrmkosOz/K6DQj1SS4C5YzVuo5DCuNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; c=relaxed/simple; bh=LzvDFFB+TelTfSCAfgpCsKNARcocA43Ip7WAHqdgf2w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I/Wv24rkpEmnimaX4YrLWMn60HYIC/jSsF4/lJBfuvuDf9QyGkG++y9PtQAmNf81lypttsR7AjOmTQ5M4SuwdLNq18891wOzXReyQoWZvvnJpW6Wbi+iUxjH/bTr3oFTeSBQWUF/KXnOamiCg3tkbgGQsFpuYAHA1vpmm0mpZfI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qtqGdrzX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qtqGdrzX" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3FA88C4AF0A; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=LzvDFFB+TelTfSCAfgpCsKNARcocA43Ip7WAHqdgf2w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=qtqGdrzXIOH1iyZ2aH1z8tK08hnfZ0TCwyNJP/XZg85kvgf69iTwDeAPnHKa0NqCV lsP+E5wuFRXPeevETdxpi+iVzo6gOVVEZJ3OZleT5G+SV2O2Th4aUB8nhVAKJwbByA 2woHqFA5Lb88TaMVuhIE05m2AENXvocq9SFQipOZULNiiLAkkhJSdD/mW7RPS1cqmt kidWTBynJDe2jCq30DL9PR5mDwIlVQpP5oSEzkb//0t1hJZ4Vgp3042SV+2oaONxAz wumCPvcfw8HAAqzAdlorEgcjrw5ZN068eZxWGbWaw+dPJkq7/Okvosu1sEAq7F6eBv xa+QjP3DFuv9w== 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 2B435C3DA7F; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:53 +0200 Subject: [PATCH 01/23] iio: accel: adxl380: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-1-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=837; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=4H4gd1mTf71nKs//tKbiKvw51/pe/swi+OU/DwsYlO8=; b=UhNwEc2LqguPS+kPVUDA3jFFCWJYp2ygQzUmLt4TUoc4j/3SCy796NjQe2DVNWwATHkADS92n /ts7cNrtSGSDG6wZF7Jo7VJ+3xKUGw5HwS5ljjFkj5TFmWOq+0aNNl8 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/accel/adxl380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c index 41b01792161c..98863e22bb6b 100644 --- a/drivers/iio/accel/adxl380.c +++ b/drivers/iio/accel/adxl380.c @@ -1110,7 +1110,7 @@ static int adxl380_buffer_postenable(struct iio_dev *indio_dev) } st->fifo_set_size = bitmap_weight(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); if ((st->watermark * st->fifo_set_size) > ADXL380_FIFO_SAMPLES) st->watermark = (ADXL380_FIFO_SAMPLES / st->fifo_set_size); From patchwork Fri Jul 26 08:22:54 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: 13742464 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A65AC176246; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; cv=none; b=OW98YDdZ+WOBxDp7dRcFdMrFreN5jyaeOjA3ngfX7pO3zMmGPZmfttilZzdi2TJ1qS4Ms47hgp6zm4TY/1KSBFPIvRdkIpBvCUPyBrWCWCjDKpZ3XI0fq11zc4PrFTyDq32DfDRdX8izUT5rr2c385FI3+7k7P8vILvm49UXCZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; c=relaxed/simple; bh=dfsq9WXesUjhbKDtpY0RiTZOI95oQv5z6XwXaAoOuH0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rck2QB6+QsNRpkFn7hAh3P8pq+9xvzlRtCjVY0E/USDVAXj47GaWbLAOTYS8tXbxvXOW3sc2/tS34XD8O8Tgt7LrqVSgEMC0G4HsN+D8qdhGDrYcftyvdVr7VWD6bz5DJZQL0iUhY6qbBsDYukvoCJhxi49TjUPUkVKAk+IaUZs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bAeCjuKW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bAeCjuKW" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4CFA4C4AF0B; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=dfsq9WXesUjhbKDtpY0RiTZOI95oQv5z6XwXaAoOuH0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bAeCjuKWzTG5YdofyfYqWmClLvx5xoqta28cThf5tEcXIkX4pPJzEj0c849G+tjzt hUCM0wVNIKWE4Z4KaPzU8vjbzaCFbqNAfgETc2sgrLyf9VBjNC0Gxkla4YXCPdVlbG bnCbaDhA3KS9vXYvtPJjiicmWWThWGz8mVZFXDRAg6EJc1CjQ5daVhAP5ewL662IP1 yR/2gXA5g8LUdaqlpbtmcYK0/6TJL3sPLuOB8Hcg1tYUsvJUHwSIxf0TbhQtnuH+CE HNmHB2yfKm0tq6usnExYN3TaUP7VDSUMS1FvTt3sCe6Exj7kmw5FhsYhQCWGEVK2Qq UHpWAwFVrKQ7w== 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 3A4E2C52CD8; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:54 +0200 Subject: [PATCH 02/23] iio: adc: max1118: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-2-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=926; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=nn62DtDibXVy47IeSmUQXIyZlnKipK1U1Mlc06sEa04=; b=K7HowwyOrxCHk/s6AK4Sic1wW5+fc03nmNJIDvIQqUlN4gtgX23F5jqgDi+fFn26kmah385Vy g6xHmcZlad2CMtUhdMspRvGDY7mECcSV5itDWrXFs0AB1wg+te5bKBm 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ina2xx-adc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 727e390bd979..0fc24bceb58a 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -755,8 +755,7 @@ static int ina2xx_work_buffer(struct iio_dev *indio_dev) * Single register reads: bulk_read will not work with ina226/219 * as there is no auto-increment of the register pointer. */ - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { unsigned int val; ret = regmap_read(chip->regmap, From patchwork Fri Jul 26 08:22:55 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: 13742463 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A65641369B1; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; cv=none; b=pswam8sAw2Yi2vk4v1lLV4wZpnC54izsc5LGEXjE51p63V/EnpAaN8CTh+SlK00RUR2xyH714bSfWxSjXb1pjyACcM8V4MZvG3EI/tgV3WCTKXa2W5kMRLELUr9rgU8Cl+iJ5bPZChsWFVgV9TuEoRIEl+1eVGqUxgPhSJ00XNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; c=relaxed/simple; bh=RPBEfCLtoa80U8IeuyjR+FaVitU17yph6ofsmxSLDx8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kzcbRhsgJL3g1rdI2G29/itZKbxCYhxYVafLaJHHBqFcjyQU62X1nGP0o8z/BeBtIE412ib3DOL63WSt6m7f3/+hEIvHhxeNqryg8Ma90WQ/P15HJR3wqvhWUjbODNvlyRFqDbbxfyvOtgFQPWPHEkeWH26uIe23WPCOX/HSOZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r9ev5Wc8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r9ev5Wc8" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5782FC4AF0C; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=RPBEfCLtoa80U8IeuyjR+FaVitU17yph6ofsmxSLDx8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=r9ev5Wc81gkusJDluvt6MnbsFTG2VaIuMyXMbAb7d6R7RhTYnD4Wau5vczy2E9Dif jw6usYlyjMo/W7B5MxSddnbKC2ogetAuC4LYyK4nP6ey51abLYOyU0OGrOwi0w9VgM CauUX5vOPjR2K6yaH5Ib5kiEVH/6cwAIRlb3gm6EIkCT04vGdFEmGd65ibF4p974WX c4CohE+vZ8Ylw+9JJO8ZroG7SxclNElvxAFEigVvF+x0YRcBEjYIMMtI+/EnC979tg 7X1hgLjWjIrHFsaeEvcvzUb6eaxo7ilNqijRs+0M4hWhZhyoOcTStyN/BU98dYLsCt xAJUMTF9Gt8HA== 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 48F6EC52CD9; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:55 +0200 Subject: [PATCH 03/23] iio: adc: max1118: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-3-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=908; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=DheHP5b+88AM4ORpC6YZejcYJvF8p0nEHYsD327C5Lo=; b=nR8wiqJfPj5SHRIp+IERpQJn9KAS+AJCAFr3ozletUYp9vHcgbtiCQsB9n9U2E5NNY94bbTCb QQ5pssu/6cdAz3E042P0iY/qXS2RbX1bc4Iw14KDSLSwJtoquhtydEG 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/max1118.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/max1118.c b/drivers/iio/adc/max1118.c index 75ab57d9aef74..0beccfde81f26 100644 --- a/drivers/iio/adc/max1118.c +++ b/drivers/iio/adc/max1118.c @@ -174,8 +174,7 @@ static irqreturn_t max1118_trigger_handler(int irq, void *p) mutex_lock(&adc->lock); - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *scan_chan = &indio_dev->channels[scan_index]; int ret = max1118_read(indio_dev, scan_chan->channel); From patchwork Fri Jul 26 08:22:56 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: 13742465 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0EA1176AB9; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; cv=none; b=RysGoAEFo5BYwlsB5h16ii+Wc+eAiNercIQmh97Fj9Nsi15G4juKOf+iCySd7iyoka5sOOqWx4djIx6tEYUX+sYjn23Eq+eBf+6/txxPf45OcdT532a++mcNM1JjmGmzwgTPN9fNzBrSbjQmz1kBoA1rsTXKKS/SVJdex6M46cI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; c=relaxed/simple; bh=oe8PYLHkYuPtuvvy0SJEHViBy3af2R0M3XExrRg7rHg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g7wJ9BDQlHBm0h+szSN46jDnu7vFybdcsF0JwpoMslyenbpw2zhqp20z1COpSIN2gttyaDIugf6SHwThqhyxpOigqaKbTsawEMGMh22gxCuuhUn1jl8Ovf6aQG4Sh3XPRfghISP+IwrdYD/USL29J+mPEdlT1nO2KMJ4BYchPX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UR51aywX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UR51aywX" Received: by smtp.kernel.org (Postfix) with ESMTPS id 620BBC4AF0E; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=oe8PYLHkYuPtuvvy0SJEHViBy3af2R0M3XExrRg7rHg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=UR51aywXSxEx1yhZR0OVsujJjEHRcbUoMk67jZ4JFSGiddvjClYA4ZzAWRHf9p7W9 D3VzEt5epjMykl+COcuYQ2op4wXH+3vJtnbBMDq5c67/FHWU9otCzhh5CYi3N79HUn pD0zOTlfUqNRDEdftjE1IRFsZB0ze39DLzmDwJy4rdxNQdaBizaMjsUmakeRtXQIMU tAOelIu/lHpv+ZT885a1WSCnF2lFRuuQqa8EHmTm+n0h9qy+qHxpOf+r0qiqfWVmeh hojf1vBqt4oybROwemIVzQ7qegj+Vc7g1N+iYy47Y+dF9xXbi7k4YazZI7DKxKiYF4 7ToawGv2n823g== 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 5B0E5C49EA1; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:56 +0200 Subject: [PATCH 04/23] iio: adc: mcp3911: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-4-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=912; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=1KkCvDVTiQQj9ZCfOwbqyke/aSJNCQQgce+lEqp7arg=; b=PJ2ERIm3Y7YQuE/0nS2Vit1UFVvEoKeXYXfuf3k/e+LbI0UTkLnUDl5YVrxAwSfRt56phG3a9 4HFRT841yy7AJJB/KM++DvIe7hx5B2xCZk1nZqsWiCPjqau+3H0mmJB 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/mcp3911.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c index 5076028f541d..d0e77971c5d3 100644 --- a/drivers/iio/adc/mcp3911.c +++ b/drivers/iio/adc/mcp3911.c @@ -510,7 +510,7 @@ static irqreturn_t mcp3911_trigger_handler(int irq, void *p) goto out; } - for_each_set_bit(scan_index, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *scan_chan = &indio_dev->channels[scan_index]; adc->scan.channels[i] = get_unaligned_be24(&adc->rx_buf[scan_chan->channel * 3]); From patchwork Fri Jul 26 08:22:57 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: 13742467 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC2F6176FAB; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; cv=none; b=PBDwcB3PTjjtzTXqtoILhryMTOcEy9tO/k/9L1vnhLycw8t4XPYi4IKweNdMkYx9uL85/oDWTxqLywrla0LsRGA6YsgWSOMTxMPo/LH2qvgxbSQd2cFD1sA/1vHILNg06niUZkyNfoqpQRPas0P+QaTBHzGjtEts0TbX3fHdKKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982180; c=relaxed/simple; bh=Gwn7ZTUHlECfhYYacHALhwZsJ0rmOVOb9dtKY6d6B8A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BSj/nIq6qImyDD5ZF7Iz4HhbkYK7HwQV+teEI5I5Nnax30L7pa338/huE64biN+bX6jPNViiymIkg0tcGqou/ZLz+whvIyV35bTQqHBYNrhRjA/zyT931awmcgN316GAB+Da+l/c9jliOSMi9p1bkMNm7uG0JzDHpaBLs8srvaQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qJtFYKq4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qJtFYKq4" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6FFBBC4AF12; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=Gwn7ZTUHlECfhYYacHALhwZsJ0rmOVOb9dtKY6d6B8A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=qJtFYKq49obdq9Yz7lRuhsjNZ466aeW+X+vdF9qKXe5OcAFByC0N9kQ0QUANm9VmT Nxo1QF5iuaWermckxeI9jbzDOLU3VwWojGgyHLbIyTDf29+nYANGlbglGz9e4HLpOv 3OKEj4WM8c/XASsp80xzAfAizWXQHfq3QJ+ln0+Dovnbtd48+VpoesNVJthfTCKqpR 73VT58GOOiKODrjo4/UZxTPwnth9OZ0TnVcL6wi2vdFguwEo4CK/MMV5u6wwWdp0Ew Up+gpmiRlUnbdOQhCNHohj20/jcBg4w74Cu6ZkcJwpf9qLyb3BB9HexgB2XpvcSMkv Ky4AHuCu4qFdw== 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 666A0C3DA49; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:57 +0200 Subject: [PATCH 05/23] iio: adc: mt6360-adc: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-5-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=948; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=taLxe9Vc9oQlWigvEjOpJItzkkFm/mOSh+oraOTypJU=; b=extdcZH9h4D5owPJaeCrVkF5FRVuEYGg6WbJK9beg7bryIg+ygmXm/j2ykUISALFdDeQnTfaa IsedS9SScB/B2t79pK0aTzgi1Ux1+hLmhPK15J4yRJbpOIbfgW9ZJrc 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 Reply-To: nuno.sa@analog.com 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: AngeloGioacchino Del Regno --- drivers/iio/adc/mt6360-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c index 3710473e526fc..f74347663ad80 100644 --- a/drivers/iio/adc/mt6360-adc.c +++ b/drivers/iio/adc/mt6360-adc.c @@ -268,7 +268,7 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p) int i = 0, bit, val, ret; memset(&data, 0, sizeof(data)); - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = mt6360_adc_read_channel(mad, bit, &val); if (ret < 0) { dev_warn(&indio_dev->dev, "Failed to get channel %d conversion val\n", bit); From patchwork Fri Jul 26 08:22:58 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: 13742466 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE584176FAE; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=bBp5Z4R5H6y9ZigLT4gNzOAuu5yWl65yDqKlqhBNohYPBhzDbryVdH9Gat6O84Md5ROkmKOa5fOQPPrjgu4cLW4Q2n5t9d2ErZM38ImpWe74vdFZ5PN08KjwBQp01+v+Y9mN8x+VgpADlg5Xlvxveapl687uRVbadLHlo1E9hHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=kNqJmyZGWi2s9us3oGct7nOLdZkNx3oLHbRT8zBEtls=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UbSROcIey1L6tivR0H2eg9FjT82mAqKD2lGSrDFYICiANr1jHkw288jaL5IdAZKprun+88IBOOzu4T8NMh/1BHJwBApqMF+4X/RDySsyXBwG45VAq6+3KSrqg4gwHs6ujXZlUbdYJ3Bl/1Bj/9IaEle4m2tZckGlaLtGBxP4m60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FL5Nn1Qs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FL5Nn1Qs" Received: by smtp.kernel.org (Postfix) with ESMTPS id 811A7C4AF15; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=kNqJmyZGWi2s9us3oGct7nOLdZkNx3oLHbRT8zBEtls=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FL5Nn1QsuDMybWNcqEEK2hAHX7ocj66RksypVQzUbMFD2dDPvTXY+ZJzBd8U1rspB lTCoeBMI1TFnT3cMRP6TJLgq28zz0Yl7k8yqE3s7aS8ErBiJpWp+r8iK5IuGKTctFU GHIYQ4yIqBTYSgStzos/+tm7JGa/i/CmQpGXh8oWlndDLpLPvRrSN9TNwOnzYgzbnc NjYrJfMrg/icGp5goGywFTmeVoXSLOZkWQiMunCu905yn50ypO9JOMZUBweHI9LOVX Xi1mRy3D4NjnzdaNnF0lf7Ez1BE+c50we1GSjhZKYIMg5GtVyr+KwoGNWaFI71xsYO kII6hj5dhyIbg== 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 76EC7C3DA7F; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:58 +0200 Subject: [PATCH 06/23] iio: adc: rockchip_saradc: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-6-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=888; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=CPgO/DJbybSsX9tw6RI8AmAF/l5lhTR2BFhQ3+DOBN4=; b=GslRyKXkKOLyJ9HqY5PxGnpcWyf9VjVwP1HcWdEyeOC1yI1DvgKx3NIOCi5F74r/vlPXvm5Mx j8vL1Eao0FgCN3tnnYPJHz1bTtWbGOSPQ8o/OOdHCS3ImkmPaj0Y0Qd 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 Reply-To: nuno.sa@analog.com 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 Acked-by: Heiko Stuebner --- drivers/iio/adc/rockchip_saradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index bbe954a738c7..71f58e3a8307 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -370,7 +370,7 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p) mutex_lock(&info->lock); - for_each_set_bit(i, i_dev->active_scan_mask, i_dev->masklength) { + iio_for_each_active_channel(i_dev, i) { const struct iio_chan_spec *chan = &i_dev->channels[i]; ret = rockchip_saradc_conversion(info, chan); From patchwork Fri Jul 26 08:22:59 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: 13742468 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBC37176FB6; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=IXQTiH2lp36pyXmPmWfdK4/gFIUTbzThxN/UcLeEaAoNVbuR7LkIFcos9TDcSfobKJkXtlrsOi9nGGdka1EDIKRUArchBjSlc3ddVfbRWgjKV0IvTtChi/0LvqMy55fCTE7s7UNBO8zMcr+JUoxW5CbjIkS1VN0sS7dExnPAKLA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=nC3POYv192Z+FAIp5HPmb/0r9WThvP45ju6pKT6D49w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Oep5n9/6CmXZ9oxhkMFTW/kUGYqhuGi2Zo4o4sL3bXJfXdMyNS1whVzuSxzh+ErOmHqqltwRu+rlRlGCeTClO1LSAulWofe+sdCV9nqKHGkDL4LUlrToWHFRjjN5Wv+5MNVYS9ViHH9jmHoft0/ZkXLf+LX7LjIwoBO6ltd/Pvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ATLxxCSb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ATLxxCSb" Received: by smtp.kernel.org (Postfix) with ESMTPS id 950B7C4AF17; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=nC3POYv192Z+FAIp5HPmb/0r9WThvP45ju6pKT6D49w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ATLxxCSbDWgYbY3SBmqoq0y8UlPmnRz7Wjnvy3lDgWVeQ5/AS9p++0mv0yupyr0Vp 49Bd3XnL2Ifo+5f3rRvOJ0Bv2mNPaGX5gJ2JraK2IJrjqBTkxX308QXHtt0FRUjLd2 p3NBuOM8By5u5/urGQfBKJSvCsGNsIcQhWyOeLB01WHwFQt622EHAHBZ3jsZtul5G7 CPfDsBU2M8NhNBAO//aYlH4dbODa9iiUv/n0/78CLNQsr9Qfccdx1q5XLeKujP33yZ iwjzsETR8rqwzEPdHpMsEMDrPlKcyYsjDt6tyrg5wvI/ofoJ3rfN+WJOa45l8dW29G CmGLtZeom0WDA== 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 885FFC52CD9; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:22:59 +0200 Subject: [PATCH 07/23] iio: adc: rtq6056: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-7-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=858; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=knlH5er1Yg2N7YkeYPSV+hi3/osuANfnkU/1A8ZVm0o=; b=cY8pNc37aUPu8/EBSFXkrJw4+uaxKK/uqMIFOeCukrXb0tR8pIhG0Zu7SZRe9uuPCDVEOOtcn bPyoSwhTa98BeM8Atlz+0uJM0UB+ZpYt2mQISSSoVoMrlJ3MfDRKqfm 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/rtq6056.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/rtq6056.c b/drivers/iio/adc/rtq6056.c index bcb129840908..45b1b81c9fdd 100644 --- a/drivers/iio/adc/rtq6056.c +++ b/drivers/iio/adc/rtq6056.c @@ -643,7 +643,7 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p) pm_runtime_get_sync(dev); - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { unsigned int addr = rtq6056_channels[bit].address; ret = regmap_read(priv->regmap, addr, &raw); From patchwork Fri Jul 26 08:23:00 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: 13742469 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBDAE176FB8; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=CNNU5ss6AsgIaRomUqy5GDMtQoGp7XRyNy9onKotPcpjO+KR+BlVH4riSJ3zyS5o2th5TY6IXcECZQI6XZOgpZUD1vhxJAdUARHXg4LBqBrciMjct9KSyC++xKOrzzJVBtGrlVkM9DUAMatcrXXYdR/FHa6hbii8tim/PjSeLE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=npJc2jnvH/dPxB/J6J0wM53WWdN+Ko3nas9x7/U+dmM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WCINWA54MHgaaPV1pwoRHfNzf6Sr8p/pnjJfyN9azgJyVxiwbGa+vrqWKuYAdzZhJTtfB8lCBpo7/wlkxTyaAb1N7wVrse1fv39Jd+zFfejpXW9J7tni2KUgVvV4tGRjak2LjJTtD1ZHZ/iETV+uFWemSWvm6HF3lxTJr4i/JPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MKVrDng1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MKVrDng1" Received: by smtp.kernel.org (Postfix) with ESMTPS id B426CC4AF18; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=npJc2jnvH/dPxB/J6J0wM53WWdN+Ko3nas9x7/U+dmM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MKVrDng1JsxKU47Qb5IDzXTzB/FovmCUpqyz3wccfZjzgXj12zFC+JTMYX0omXmy/ h9vdQnd1vDLqrpTiiumtjhLu2HfQbXSklz9XdTcEc+/0HGngDhzsXTWiNysrLDC9kA bZzE/6QFD/zZJn+rwwzGKSkQNIyqtfTi5gjHevYl3n6jvRu7AjIxkp1a2nnuP6dqNV S+A4kHZhAUD5N7+ZqoRjHJpmDk3p9zC7e/6SzcqUbrHFMZ6LnDjnSBVG0eS4ZcKd5d RDHZAyft9WhytS/Rywdd9/jvjlWU4vAoN0hFRNXzf0jHmJGIu143HMDJVyOjXFAO/r +aMjtqgW+LCOg== 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 AA84AC3DA49; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:00 +0200 Subject: [PATCH 08/23] iio: adc: stm32-adc: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-8-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982177; l=1283; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=HE1VRfKigITTw2AxPcLnqYl/S+jcBrR+clI++DNvuZY=; b=9eZZNY65VYVI3/oJnoG7KIr0BFD5g/ISCZ/fLKLzQaQJqqaSP9foay89jKBytQDgUTA3QmIcJ 3R8FxHZNySCAfVlpHSCHjNUtqxxlKO42/2PQuPodX4RejQRdzIKMq6v 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/stm32-adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c index 375aa7720f80..c901ba1bc6ba 100644 --- a/drivers/iio/adc/stm32-adc.c +++ b/drivers/iio/adc/stm32-adc.c @@ -1261,7 +1261,7 @@ static int stm32_adc_conf_scan_seq(struct iio_dev *indio_dev, stm32_adc_writel(adc, adc->cfg->regs->smpr[0], adc->smpr_val[0]); stm32_adc_writel(adc, adc->cfg->regs->smpr[1], adc->smpr_val[1]); - for_each_set_bit(bit, scan_mask, indio_dev->masklength) { + for_each_set_bit(bit, scan_mask, iio_get_masklength(indio_dev)) { chan = indio_dev->channels + bit; /* * Assign one channel per SQ entry in regular @@ -1619,7 +1619,7 @@ static int stm32_adc_update_scan_mode(struct iio_dev *indio_dev, if (ret < 0) return ret; - adc->num_conv = bitmap_weight(scan_mask, indio_dev->masklength); + adc->num_conv = bitmap_weight(scan_mask, iio_get_masklength(indio_dev)); ret = stm32_adc_conf_scan_seq(indio_dev, scan_mask); pm_runtime_mark_last_busy(dev); From patchwork Fri Jul 26 08:23:01 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: 13742473 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C2181369B1; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=NvQAxIy//jx8/we8YM+eie+LRQG0S/JZXCD+v99Fod2V1A5O3HfzpauyMaLDpZF4oH9q2YxzPkHPSyYeJsyQd6GhXYaJ/opBD6nyQxGf/66fW0JDPoHbgta7NQGNFF6d/4Lpyg5B1+a7qyRWqtYNDGsvR6J2ZpLz5bceDysii40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=5lWBN3x7yzmJzI21qdeZUQEtQmV1CWl/qAfX28wS1m0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=McXIbEmzqjMrKIrlV7vIfwB5f2Ce/vnR5y0Sz/eS+wWaUXWNolRtnmA6Wdy9FIZNu9lO8yv6TRcXzKK741xRkTK2LrdhV//0xH4JX+sKvrqTKia3E80uYpxpEONPd8Idk7Ne5QZ5/dX+cNL2FJ8VhoV38Zj0TCwUSsEXKdyK2ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ToXL54IP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ToXL54IP" Received: by smtp.kernel.org (Postfix) with ESMTPS id BFFA9C32782; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=5lWBN3x7yzmJzI21qdeZUQEtQmV1CWl/qAfX28wS1m0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ToXL54IPqtPoxYWXSTUfO+Sg0e81zbStINhnC3eK89B/LbKbucMaE6TRpw86trtGU YvxhEeyd0t2p5fjV39Dh22uwsdbto7/+C+IdxfeHMwd16m2JeWyT9EYy7ymObKMzF1 1pFq29LqCCTSao+0rtekht/j7nWc++BIHvVmWL4AZ9zwp98rPqq4s5g5ej1F4W8XLD uUOnzhZL6+CWJkYMqiVhPjMQ7LcUeFHO5xcsL9PifepzxTRnGgstjjuMiE2D9h7390 IXc5Q1k7rCEsK+EPUcY4k4cNQ/ic/Jv39gCpBxuD2cNBeZ0l/izQYmQF/oMfswARyL RR5n3BmcYB2gw== 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 B7464C3DA7F; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:01 +0200 Subject: [PATCH 09/23] iio: adc: stm32-dfsdm-adc: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-9-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=891; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=aTgdqh0aJ1pDba+LtwcspxT4H9yCpKDHYZJ0iNZrIwE=; b=qTE3TyReW61ZawmIaxnS8JEFNUS99QanZ+9aNsvDcl5dqwoWeW+TXGjOqN0MLDIUIT6EWuKte luKnQ1LkDdyA47LQ2ebBiOd5gkHs808gjk6oHb5PyogY8P7nLgx84js 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/stm32-dfsdm-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index fabd654245f5..15b8a4c0b272 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c @@ -987,7 +987,7 @@ static int stm32_dfsdm_update_scan_mode(struct iio_dev *indio_dev, { struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); - adc->nconv = bitmap_weight(scan_mask, indio_dev->masklength); + adc->nconv = bitmap_weight(scan_mask, iio_get_masklength(indio_dev)); adc->smask = *scan_mask; dev_dbg(&indio_dev->dev, "nconv=%d mask=%lx\n", adc->nconv, *scan_mask); From patchwork Fri Jul 26 08:23:02 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: 13742474 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CE78177990; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=KRrXIj2oPnhJ3nB0ynIk+jUxRqugfPk2tYN8Ly9WksXUIG9TUu6fp7XLKiCWrKGBHf4K6A8dy84otdq4zpnrJNJTvHAnsxLzAGGY64jkiTG5M/Y1olVP7lyOAHMZ+8Kv7xJvfuRCZYhTaWpRyC7X7LKflpwOyf1XL2Me2bkIL5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=umD1IXfi/h95QQhMz4eWJTx8O2TaBSWYesNTGeRdxII=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AF7Zang75foNSf/01vvK8zejdaeD9v2z2RR8foxuT+v7W3vtdO39GeBmEj3LdVz14zlcByPCadvZ4khGK+Gnwh+xEAcZ1hKFHr4Yl5a+2HsO01cQsWuaO2ReDGrDrI6br51R9lrAAkTsveW9R5KKofLi0YlLcGhVYYXeVWq87KU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uhR5MQ1U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uhR5MQ1U" Received: by smtp.kernel.org (Postfix) with ESMTPS id CC7CAC4AF0A; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=umD1IXfi/h95QQhMz4eWJTx8O2TaBSWYesNTGeRdxII=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uhR5MQ1UbywD/sGpU7PvS4RRLIDTtWYokMQE7yvKONuRCcB8dIWQ1ztlI9VvqrpCX hV8f5MdpljPSGrCZIYsMj2d6RAgSLlteVvfmBQ36QoAlFI2VLHeKUhySxMNr6hGa7n XdtcOtHlxqLq7A66oifTTYY9WwlaA0Tv0fxx3Qv3HLtqiG87V+QUHYymZ6JCreTtfj PDoAoE2gNQFNKDCjYx7HoGQUVxpCQRSKPQaG5yploCBSJ9vKtJ0Yo31r/s0mfWk/5M PHoOvfBVDjQttc87gyrKUWU0J0W2qOQMc8xZWIJqbW84HLwUe9xiiqy5gWzsv3li1Q DNfw1St6Tf7Mg== 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 C3D26C52CDA; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:02 +0200 Subject: [PATCH 10/23] iio: adc: ti-adc0832: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-10-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=925; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=/zRhs+O5dU8RBr+bA0UyWxQ7bhGuFDbxpfRgXZ5+WII=; b=MQ4GGvW9pKcxivxR/c6CDelUg6zYahU1CzZdyeqX/tyLj5KopFY4oMsnbX6sseHma8Npd3ZO+ TTs6JeQU5sNBUtSFyal4UdETC3vl9Rb3X99qollaj63XIHva8luakJD 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-adc0832.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c index b11ce555ba3b..d7800e1fa536 100644 --- a/drivers/iio/adc/ti-adc0832.c +++ b/drivers/iio/adc/ti-adc0832.c @@ -211,8 +211,7 @@ static irqreturn_t adc0832_trigger_handler(int irq, void *p) mutex_lock(&adc->lock); - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *scan_chan = &indio_dev->channels[scan_index]; int ret = adc0832_adc_conversion(adc, scan_chan->channel, From patchwork Fri Jul 26 08:23:03 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: 13742470 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11AD4176FC9; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=nllMSobhYGf/8LI8u+uyzHFo4nuyoujuRgocgJjqSwA5qbPRut0kFXVCPMaxugn+aJnkL3h3kcsmMUEPcglg9l7rny5WcsAuKfYNs46j5W0DJzGheM6aSdH74nyvxi7Ys/0sa+q9Z80zgIEOAhMWWSNoJ8TFTk4kByjQKQ2g6MY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=DYjDQzEKOXmhB8PTzPSGHJzBrh3vcbTTXhqdNbtWjhU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z5YMN8xXFb4vdnxMUP0kjfFdBmkrZJAiMChY7eEZeECjFQ207NG4ihStt3TBxVlcBOtB56krGYhorh6nUVL/P287EnzkvV4cBr0cVzJyg88fQqcigQDRhEiAuYmDiQzZoilm3BNlZiKzOiynlmXWtyGo1MtR0wc4PPqJePoVTJY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H8Hk8lGX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H8Hk8lGX" Received: by smtp.kernel.org (Postfix) with ESMTPS id D9171C4AF1A; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982180; bh=DYjDQzEKOXmhB8PTzPSGHJzBrh3vcbTTXhqdNbtWjhU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=H8Hk8lGXCGuqIaXb8Si0n0bpYqZZwOXNroYpkGQxYe6mjRZgcjN7errPH2yT79vR2 1Bm4GvBHD/89LnDRiRshChf1zx4UH62bqTQkFSfH7gxV9AQwmpmZd2MiEGxqlxMJCb Ar3N5XC7ECs/r/e4N3YDuynJeMP1AlNjEDpwPqok7IVand1arjankDMsJP+/ufnMhv z/nr4a2GlKYl1fzNDOiAL5ZF1kdExAZUiIRtx5K5ZcgGJp/1r8m+YzRCUhbI6W9MDw PFiGcjzFNM4SnZKhOAQgPBMBvxnpJ45m7oS8f6NfIaSX64Mr/h7KDYTDYYxEpYpVH5 sfXqDankE6XoA== 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 D0A4CC3DA49; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:03 +0200 Subject: [PATCH 11/23] iio: adc: ti-adc084s021: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-11-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=929; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=pDmrdCKFwcJ+Q8/Qez1fqIpNvLhBZN1RCKpdGSXSeW8=; b=jXDGG3lYnq+qxjsUL1eRmtxRuz45PCumiCb1suSE7NNVTuUyrTBJ89inAB3uLkgAQpIWkkdGW DFLCbD7PhK6ADOI5S9Cke0sMXm4swWFQ9uRQLHHEIl6fI0OEPmQXk93 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-adc084s021.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c index 1f6e53832e06..4a07c6295a2b 100644 --- a/drivers/iio/adc/ti-adc084s021.c +++ b/drivers/iio/adc/ti-adc084s021.c @@ -166,8 +166,7 @@ static int adc084s021_buffer_preenable(struct iio_dev *indio_dev) int scan_index; int i = 0; - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *channel = &indio_dev->channels[scan_index]; adc->tx_buf[i++] = channel->channel << 3; From patchwork Fri Jul 26 08:23:04 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: 13742471 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14DA1176FCE; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=CJJ+4uItK2rUL7MFwywDTANMVfWxVriEqNtfBSDzV/WyJCj/xC76kz+TPZFrGtu92gyvuOhwfrOBygNUhJhnx07xR2FPhes2++tfaNWVjttDy8JUVfZ7yK0pGTfleeu78LXfncInTxLEM7c1Z1gpO6Y8hPW1CWZX4CpUImKGMV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=402Dwm9EJynx+1mrrqvRMo6y3W805dGu4Xm3Y1Jkk8o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bUZTU+S2mzGIsRap1BnhiKzWmu5qCgrhtDe4V+jQpcIVDpDGs0K8ru4Ok/wO6ijY8EWOmeBBm++UDdod5g0ypJD/kLbd1Pn7AtYEUNQU3LfpMP6RCCZM7lZk9uNi1F8K46MMAOAg3ycqlqpyb2El96aecEOrCppZgwbjeD+/Vjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pLhCL9hQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pLhCL9hQ" Received: by smtp.kernel.org (Postfix) with ESMTPS id E807AC4AF1D; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=402Dwm9EJynx+1mrrqvRMo6y3W805dGu4Xm3Y1Jkk8o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pLhCL9hQS0tN2qW7GRNfr0b2xdwWk4/aPz+ka9eZJEgyu6L6aA84wqAqJHfFJkphW rdTRsXJBHSJrXPYEcm8ZRVq1EYsVMXltuDDdS8COTFnUF7GnPJYChz8vnh5ZHqwhH/ AXJpzEMX0ZSqcZAvg+7mlT4bq9at6fwYu67mOqd05UZZSmeSQA0tzSjRtX6cBNw/p2 uAqSLdeXrnYxLaBhNPfAibrl+wAN2YtbHxC07/is0Nc9tLoWBwmotIcgxlSiHuSYbf vRLUiGQ1983oLnVB951AHZyki+T7i5rSdQffU5aLIsN0o3+SgiEcd/j1BAXZaK7wi4 D9K/Ji8iUedMQ== 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 DECACC3DA7F; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:04 +0200 Subject: [PATCH 12/23] iio: adc: ti-ads1015: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-12-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=817; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ros0/KTpvpHjj+SLIUp8X2OMblmp93RuOlqoJiAk9Ig=; b=EFOEra5KEDEFHNMAogNGWW6BAHZEP+AErylMLRgjYMLPvEtxCl20KZysf3uMt+w6KOvC2xT+Z KjYzaiTPUYGC7DNU6n0QAT6ozK6qJJKYFnJSpPf5tt3qTiO9P6NUNeS 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-ads1015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index d3363d02f292..ca432c49eab1 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -456,7 +456,7 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p) mutex_lock(&data->lock); chan = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ads1015_get_adc_result(data, chan, &res); if (ret < 0) { mutex_unlock(&data->lock); From patchwork Fri Jul 26 08:23:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13742472 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23150177982; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=saMz2rZ6crRyKIlasrrNQGH49bAuIoYsg7PHyToQCU8Azu7PogQIFiAgHkMJ+6Mbhe+OfeE2ii/Dxc4yAuMUPV3Qau5Df68Ve4zSfc42txEKEzoAw2GhUKUAwsZJPCGZsSGEG8gzcmVP2BjdhqipQic2z/rpC/tWjIs6QINan44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=nzUWAUdckXIGph1ePT/7063qkyAusr43E/xStTlrsEY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hN7z/ZHiTRePwU+to8PlZ8h19xmqzX+XCn2XsjP0Dx470Ljzei8sS8G//cOUQ9YkpY4nKvI1UFyTCtaeOqSpgyUN94wtu6kBGL7HQbC5c4hSspiSG7G5Wzm47MB8dgwDt/WlgdUZdGp9UzZvq1zuVZHOGrod+Sb9pnL6PuXLERU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=feulg/V5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="feulg/V5" Received: by smtp.kernel.org (Postfix) with ESMTPS id 04C17C4AF11; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=nzUWAUdckXIGph1ePT/7063qkyAusr43E/xStTlrsEY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=feulg/V5lmrZD+XstVWm/r08zytvlEvyLHe3XOZxKVvYoAOwebJpdoP5Pu+pIReKW YKgLY+69+sx4Cx80+xuDQHP5oATPHrF7y3YuXGdv9O2nBXaFhRNT/g/KyRqSi17GcK KPDMQuefk2uNc/fsmtKnmO5IL/HcTmTsrLVzNpOkoswbhIuU4UAgP/8dz5r/VHf47h RxNuzc8/5K+tWOubKF+bl9pp7IK76ZA8QkwyB9seagkR38H5z1SW5a4vTy/2HPGHng cV1dbp9dkRu+u/WtnkJxT09MUr8kWAS3zXrLuBwc7YUfCro+wFYFANgEQ7QDxUKKE0 tqOl0QYM5k1AQ== 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 EDB3BC52CDA; Fri, 26 Jul 2024 08:23:00 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:05 +0200 Subject: [PATCH 13/23] iio: adc: ti-ads1119: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-13-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=1136; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=HnDbSftd+e0Ucp5FBdQe7pOcKFrEr/hE1TurBJs2zNI=; b=3FAN4ZBfLYDF7k1ISI+aJeeV5O6Otw0p/Vs1ESTmIKNRpp/aEygYyDiCwgjT6pOjx3UiXV9oA 7T7b7WBBP2tDiGj5Ap9GHkFNoRjocoiSYz1mP93QZ1YXMZUqQ+QX19G 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 Reply-To: nuno.sa@analog.com 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: João Paulo Gonçalves --- drivers/iio/adc/ti-ads1119.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c index 630f5d5f9a60..44d9f69c9df3 100644 --- a/drivers/iio/adc/ti-ads1119.c +++ b/drivers/iio/adc/ti-ads1119.c @@ -435,7 +435,7 @@ static int ads1119_triggered_buffer_preenable(struct iio_dev *indio_dev) int ret; index = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ads1119_set_conv_mode(st, true); if (ret) @@ -508,7 +508,7 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private) if (!iio_trigger_using_own(indio_dev)) { index = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ads1119_poll_data_ready(st, &indio_dev->channels[index]); if (ret) { From patchwork Fri Jul 26 08:23:06 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: 13742475 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33019176246; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=fR5zud1GScRxhHvHrj2vrUN11EySKJ5ZlXNISgNZlgNN4HE8a+e4Jh1MD9i1362R5Oh6kLVWC4x84npNYNnG1oGsYx5jgKG3/2LD36GMjywLTRFowlQ0U/v/us+DZDYKl3UZXEHpKsgmvWGihLXtMJ+5Bo8KfGSLXlJrzqSQYDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=zAvrC8FGXj77GiRK9gtP0Q61104VQzNebdy4cueU28w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VatwiGJlBf+EvXjgszFlqVP0u4J76YVwzA9wKq0VWvTLkk1TZ8/5B6gCJp1X5jY8TOp0e0yirKryVbe4t/FRfduHxqeMUHOJMk9k9g4J9jpLTg4xqS9hWfTz0qeIlaDkRoDTjo3+jcVQyql3RZ8xqjRfKkNpvfSuRza2klVyj40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ehwDI3au; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ehwDI3au" Received: by smtp.kernel.org (Postfix) with ESMTPS id 157CBC4AF1C; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=zAvrC8FGXj77GiRK9gtP0Q61104VQzNebdy4cueU28w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ehwDI3auAxgTZpdDwi4Wyg6ORYenhF/Cp1OPouzlyFwAeAL6KVoYxiFr1LfhvfvtQ lpuzjnnz/r+Q2ybkuPL9x9yIxPy+hbODuw0RJpDYtfmjllOIvJNCjZNqAKTyr+V/fS IdIH25RnvN92n3T3sr5NcFiJH1JH6lqu4ujXfr5ZQF/mz7ZV6Fiysc9xvy/mxjeLn7 fvluLoN2w+1Rc74g1NsO99OzNmpjSGsUHO9rO9fIZ1wn6TAjkumR+aaYQq5+AaRqwN iqnCkuFO7WBO77CfWB6leO9A0MAhogIYiK/XfHBbI4raAM7FZauIDZB8SRLOLk6Z8v 9w42zwA7Xxo/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 0C3BEC3DA7F; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:06 +0200 Subject: [PATCH 14/23] iio: adc: ti-ads1298: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-14-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=942; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=WR4+V9qNOnxFXSApS/dE7riP9G9UG30sxOIHDEDM8pg=; b=ABjdENBRlRCm1CS6lUjav2Z/s60wYwXJeWfDm7wTp5gRDWxEqEEjBKnrGT0fNKD9FVFQeY+NR gjhZoRPlg+ZAWmTOxCUfM6XECTwSHGM9wtWZti30ZNSWyfuojIlio2D 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-ads1298.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-ads1298.c b/drivers/iio/adc/ti-ads1298.c index 1d1eaba3d6d1..13cb32125eef 100644 --- a/drivers/iio/adc/ti-ads1298.c +++ b/drivers/iio/adc/ti-ads1298.c @@ -502,8 +502,7 @@ static void ads1298_rdata_complete(void *context) } /* Demux the channel data into our bounce buffer */ - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *scan_chan = &indio_dev->channels[scan_index]; const u8 *data = priv->rx_buffer + scan_chan->address; From patchwork Fri Jul 26 08:23:07 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: 13742476 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4304B1779AE; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=lpbvrNhT9JF3y5dMbgrv+afM9KppWqe6C6C399QoXl8dnDp+2Ssb0fJ9ehkFNUlR95wqT0q60yHaVkw24cIXDOPqc1ssepmtEths3uJ5yDhVyyys0gljiWvqAVrqj7HHEGXckFmqgAhcKzmTI+UyReq09oiP6nAthZUexyglftA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=9o8I3NqkG1lAqPIz5hVefBr/CncZcX9NP+bU2VC3KTI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UfoMrznBBnaYGV/KYzWWfY0H58BpCftm8dlJaabpYulWGQOV8JQc9y+7Gv8GuJfstdwRN4ttIkbsb248JISSSfdKd8QQSsfjKhRyw5p92XNX2B3suUJafbr+kUWjz9V41A/Rw18dcBGXFSWTfdUMQ07TERD7aJQsN4Agp0VFr74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OkiKSLNi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OkiKSLNi" Received: by smtp.kernel.org (Postfix) with ESMTPS id 25C02C4AF49; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=9o8I3NqkG1lAqPIz5hVefBr/CncZcX9NP+bU2VC3KTI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OkiKSLNi9uWz2Z4/vR62H53qeDsy54R7T/Ebn+S5wZmqPTsHSFYbwOpT+wJCSkAA9 vpIduRc+bHzLlf37/Rs1sQw6aQ2OSCFWg+1BRX6UuHlwdwkhBhzqrAQ9e7qns7Vf8F Iev8qFHn+Lz7T/q2KpzRv5bNe/3Lt9hc0mB8aarp95BgQ9iPu6hD5toZ99ZEJPyacS pb61i0ufFNBvaygLFrFKz+W7lkJwAe5BPyOp78JPzaj7RoB4bkeolFUKSfqG0JoiJT uYVt3UtI1kNu8Rk1rdGpBvPW0psHIXkRHhgZ87uPBeAmHPreEA8vycyQQ38wSDiORR 7rE35+6z0F2Dw== 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 1B7B8C49EA1; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:07 +0200 Subject: [PATCH 15/23] iio: adc: ti-adc12138: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-15-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=872; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=JlJjGB3lg1jNVkw6cQ+EWvwyLYo97WC3H7QNVgN9TVE=; b=LPYb7OUDdSdoHOHRuIJxFdPlR0k8K4xrVDG3tT0L3FiVkgEzqPzPYtOHRVy7rl4e2wHrl3JQt zM8FNNhlONgAZXZTSkVCKampaTXtqhs+TxY2QZMpTYgclVVLby78Whn 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-adc12138.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc12138.c b/drivers/iio/adc/ti-adc12138.c index c0a72d72f3a9..a2cd8c454e11 100644 --- a/drivers/iio/adc/ti-adc12138.c +++ b/drivers/iio/adc/ti-adc12138.c @@ -344,8 +344,7 @@ static irqreturn_t adc12138_trigger_handler(int irq, void *p) mutex_lock(&adc->lock); - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { const struct iio_chan_spec *scan_chan = &indio_dev->channels[scan_index]; From patchwork Fri Jul 26 08:23:08 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: 13742477 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5357F178363; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=mO9BSaYMm5aI/B1nGoCoVN/7Z0h+8Z5YC3ujaZNghu+AIlNZUO22EETCK/fGmkg6NzWhC+HsT2/Rt/I9/miWsgUuaHiNWtqWZstz1mgOL0G1PAf0P8+mIy9OyeE41bu1j4U39tFCAMaVTq6tzvvC+lqkNFl/wGEnExcPU9ANnzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=OdFAmfqn5OYDoEM2AFkjOAkfp9UDIgGQCF9t0mvJcoE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CSj9hXoWc7CLdnA4sztIR7x4pJYXfMbMktAYjm2e624vXeiD0VzqzUMqSkJUpM3Q9E0nspxVvJO9/ECjB4O9vzNDOR2ZWOjVzTXwwjQshbUiMBpXUm4+rRFZtSraMbXY27wDgkPm5z1EIzIIOVkLn3VGDGftGUpZytjyqL3Ij8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RmcuPf75; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RmcuPf75" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3642AC4AF0F; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=OdFAmfqn5OYDoEM2AFkjOAkfp9UDIgGQCF9t0mvJcoE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=RmcuPf75bEOi/Rl2uvfZrApseW6/anyPC+lu8dEtzEdwX51IMofUz2sjdXcz0TfNZ eVFlnd1CMaaO9AT7hYVuatsv/JntzlZmiFd9G8Jc1ZnXhdsO4HARrshgIWXoNp9jJn WnzTV6yvbj1DCJRytcempQt6TMFiFYlpD0V1Fc4ioyZkgj5r80fhdTwc5P5mPfRs7z Z207ICAoWEo5PmmPcBIQzje633AJaCdFuCDcAySSzKmd3PRWMHA1+zb3LWELsQ+eSd fbZHYORLGfUn2fsv/4abXeZ/IQyrRG6G4LE8kWd2ffL5QYHayodrS3zKG/qmHONsPJ Y+ViiB8ImhnxA== 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 2C10BC3DA49; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:08 +0200 Subject: [PATCH 16/23] iio: adc: ti-ads124s08: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-16-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=892; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=KjfjQzdm2bmltYrEkWRpiKz/U9ZMi6Ze3QqEmoK9kAA=; b=7L41U9fWy71xRJLeii57OtixHdlLNYPXf9ukClL4uXPdoC/3gwmAc4Wa2XhL7+PLyLv1a1dMj CfISDVzxnd0Af/QNR0BRNYe2RYAP7esXCgsGs8hExBos/DT2TRDBmUW 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-ads124s08.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c index 4ca62121f0d17..c115f892232ae 100644 --- a/drivers/iio/adc/ti-ads124s08.c +++ b/drivers/iio/adc/ti-ads124s08.c @@ -279,8 +279,7 @@ static irqreturn_t ads124s_trigger_handler(int irq, void *p) int scan_index, j = 0; int ret; - for_each_set_bit(scan_index, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, scan_index) { ret = ads124s_write_reg(indio_dev, ADS124S08_INPUT_MUX, scan_index); if (ret) From patchwork Fri Jul 26 08:23:09 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: 13742478 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63325178371; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=QWwZA8N8AgYL+CpGJXK2e3cxh9/Md5HtWnX2oE9+icZ6BXCMmQQ3KvyPXhGYUunKg8iLb5Or9VJkEu6fEDJUVeMhUNbklvfueNNMbfpHZH1nFwd/ngMhChp50uQfnU04V9l1lSgf91GfqBqhfo1lyDQcxwoQx4eC9lTNSgtrECM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=s3XYHeiqfx5M0rPGyIr8GFtHULw30fcBEQeLoshTKRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QgTIxr6VXT6eITQyticc3lFzsbnut/0NI3Rzk/Oqmpv+ncnQfnN9s6oh2YITcUfWPv2NxzLyOb1LPKYHLm+3sdSrKGxLqCZNvj1k66hbVaF7LRqAp1HPFzDoPvbiH2hCXao1RdRSc1twR76VvbPG2NQHzVEYwa9D0S0KmriJDEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XXVb1pjr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XXVb1pjr" Received: by smtp.kernel.org (Postfix) with ESMTPS id 452CFC4AF4D; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=s3XYHeiqfx5M0rPGyIr8GFtHULw30fcBEQeLoshTKRM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=XXVb1pjruYJE46zySPWI5Yhw8veWhHjHSjlRvthY5Qjob6BPqTyNnfmAUQ5IXa/Ye bUFNxkrw4k/F+EEJD7dnTq9PGwCJP0QkBR5mR2zPnTF8a9jnZ3scKR6aqgfVQ5suDJ 9TOgbeiwANwNr/dgQ8ZAKFsrnSJKh/+/+SgmXJGq6tewoW7ayrCn195m6ZnoSMQdaZ Dhb7e7Q28mOZ2HHAesalDsLHB45u7eZAdsxFZpGzqDgKq0VjkVA1FYXLjU/OlogLI/ vZDHdqLsUxQtr8KbZHFT6ITQ9lgVesPlSotglJUTcRy4+LvFfWa56rBcknhpC6J4ry M3/3uTM3STnDg== 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 3B364C52CDA; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:09 +0200 Subject: [PATCH 17/23] iio: adc: ti-ads131e08: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-17-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=906; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=Wmj4heT1Vtbx3+Qw30Meikm6rdXb9sWv/ExTDPPdk4A=; b=0GFuG/6wJrEjIxNPymKrc3E/xuuUKG+CQZ5h5YQM00UjbUYs0fj5bjauhcuGVCMG0z8H47IEP R9/V1RWlxOyDxSrc451CqehO5i8yKtdPZt4za9xGbhvcVgRFIb+W0pm 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-ads131e08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c index 96dd9366f8ff..55366ffb0489 100644 --- a/drivers/iio/adc/ti-ads131e08.c +++ b/drivers/iio/adc/ti-ads131e08.c @@ -637,7 +637,7 @@ static irqreturn_t ads131e08_trigger_handler(int irq, void *private) if (ret) goto out; - for_each_set_bit(chn, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, chn) { src = st->rx_buf + ADS131E08_NUM_STATUS_BYTES + chn * num_bytes; dest = st->tmp_buf.data + i * ADS131E08_NUM_STORAGE_BYTES; From patchwork Fri Jul 26 08:23:10 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: 13742479 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7151E178375; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=Orl4epgHKqRLzm4U2C8U2c7tZ6jZ+8EzZzm9tyM5OIgl/QoZQDDaBjcixyYw5fisgsPY+cJk7xlIe4z008qGaiDF22yTC0KQmqoDuCy1aiXnUeNVDoyHqoBwOHg8/IgQwsW4ZiA8ymMS415zM7FEjtTTDua5tr0TOipJSXEq6q0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=23pWAgKQNvp8ViudLo/jPakwoDoYaMh00PxvEu7Tme8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FTJ3FHuQU/8P7TZOBzObpO42MQhNuvAS0gdL+SoKfOtiWeIUr/qBUni64vSHchpQUKnDJ7uYFwxCz2Mrnkh6emkdIUd1+1MZJq6Dvoc7BUAF2c+gCKvn1PFlts38tY7qPN3C7FxLev+7RAznPGDYokcjFosGZiZrSrcclQ+xoqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eRpII1Kx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eRpII1Kx" Received: by smtp.kernel.org (Postfix) with ESMTPS id 54173C4AF51; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=23pWAgKQNvp8ViudLo/jPakwoDoYaMh00PxvEu7Tme8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eRpII1KxyLroO+W8X1lQkM/J1q8PJrUZ40HHV2QT8U+skY3e1n5Dmp49nYS9HzboP gDvuqLB826rke7mSp0WazgwFkhX0FR8aTwv42kZg9LLeN7uJl8vzgw1PYKSK/xCdjg 75XHbA71t4FUorSb7ZIwKYdWOraWO/JOi/+ErFugo8E1LXdjdJ3ktkBjLYjvvETcQ3 U4MDjuJo1qgKN1WG3uvpBhHoyUVzVepvouq39BEMYckaq9FIf+w6RwF5mSNBwtrr3p inyZxRf3q9rixgltNolbELjj2KmxQk7iLjo2uzaJ1qJRan/xSTjvreboXyBTKQdvTa GWuz5hTVIxyCQ== 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 4998FC3DA7F; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:10 +0200 Subject: [PATCH 18/23] iio: adc: ti-ads8688: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-18-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=915; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=CXE9n1OTERPreNfjFIenBnsa4hUQh2QY6CgmvZVjglQ=; b=2LKulSG61dERd041aYUSUleOkTZyYUSHMCQBWl82M2dCuByYPlBFm7A9NwRxgLfy8l3ZQnOo5 8+I8g2/S+1/DVXeMdvi9BcrLXIIY1TRZW5Yln/Tm2DfMzISokyqEPyO 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/ti-ads8688.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c index 7a79f0cebfbf..94cc823b26f3 100644 --- a/drivers/iio/adc/ti-ads8688.c +++ b/drivers/iio/adc/ti-ads8688.c @@ -384,9 +384,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p) u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8); int i, j = 0; - for (i = 0; i < indio_dev->masklength; i++) { - if (!test_bit(i, indio_dev->active_scan_mask)) - continue; + iio_for_each_active_channel(indio_dev, i) { buffer[j] = ads8688_read(indio_dev, i); j++; } From patchwork Fri Jul 26 08:23:11 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: 13742480 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FD1817837D; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=rqYoLdDWofmDRtDaH5xfEeoV1o5EULmDhjezFdNADwCEkzlyWjizJAtM2njck+MPkUU2zUQ1+zDDB29x/boyIgorh5wBUuWYpRBStgNMmaVeT1QazSeD97MEr4Xge8oMPctNA3IooKaqjnBfzePWr6VwS97FKYF2vM4WB1cs9ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=NUM6O8zPs13bNzymkJdQAGtu3+DKEG0qTUf7Jmm8pXQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NJAo4qHxXw4/GjBi3IoAJhpWMBYIlIZzxmTGclVMogpbLUJ7YMsJpxgCbayJ6WL2X0+9V+wbzg3FrXpK/0sGbRVWy0i4ofOtzsvrlL396hFmjJFp2zfM/6DOxq7Rxt0HsKD1BrOMs3xcain1CyVkSOHXQTztQ5oEtg9J+STpSiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RrcQ4CZ4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RrcQ4CZ4" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5E494C4AF53; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=NUM6O8zPs13bNzymkJdQAGtu3+DKEG0qTUf7Jmm8pXQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=RrcQ4CZ45aOOd8pt4F/0+Abgf8GX8NabmgM4Q9JpPCGypinNTYTSlHu22gX40K2BZ zLwfa+Hqhe4lcODcj4xEi8eO5bUM5HlNqMGrXBb70+ya/4VbBnhJ5/t4Ymxkp/NiN5 FUAaacgYPho9It8GW6HtDq2dnCgNAj3Fnu36JBpl1rD+6WVx8IWrHgp45/zx/CBKKo 7BZN7ILvMUaA7YYozf7wBjpM/cRXNwVLl2Xn0VH+ntZoeS+eKt9dUhmA5+5bx4I1dy QMbYn25mJug+RrgKCa2hsRwyEjHe1EBg9EWM6QQmd8yH5eaojkVpx3RZX89jxa4D2U p8UWV8ae8tPsA== 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 576DFC49EA1; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:11 +0200 Subject: [PATCH 19/23] iio: adc: vf610_adc: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-19-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=796; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=Wc4AtyYctfc1fH2X+PY3+8UsRic3aqsc8yZI2tY6HWk=; b=H7FUJUGsG0/4kDxReOD9Jx8MTUahTsFWzcVC8s5r8KykUlmApEdYH6mTuKTT3WWJJBsQfksKC W8B8phS/tBkA7Wb7tkDTDElLZC2u9Ls/n1C0Yr4XS1zyuBhvQvCcGdB 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/vf610_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index e4548df3f8fb..5afd2feb8c3d 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c @@ -752,7 +752,7 @@ static int vf610_adc_buffer_postenable(struct iio_dev *indio_dev) writel(val, info->regs + VF610_REG_ADC_GC); channel = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); val = VF610_ADC_ADCHC(channel); val |= VF610_ADC_AIEN; From patchwork Fri Jul 26 08:23:12 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: 13742481 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AB19177982; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=XxqZ274+TQ2fJGyTm8lTzhyFE7CzQMYRmAUTMiDeQy7+br3Z8k5DP2/Zy80FEuD+PMinX0OdjFeTfqPIWOH15Vye5BlC1RD4Og76hkbC7h0+S3NJcgC3+sicK53rqkomiCoZqPVMQ05/v8kGw3t7MbGBH/D7oyn0riNJUW1asaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=TDgN44IgZI0RwUH7i/HAFVQMVhgZp3akiVjvMGhwalc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mo1Ju++eIKXavlY3fiGq3uMFRXtip2Os24PWQGSpPd6C0q2s2oyuwQURK+S57nYlRHFnikE70p6tk70KLJrw/jnEW0xsvHzVqOJEfQI+hKqYvsQE/ndK/1/mRiNw3DIgzFOzFwNCvp8DRWPFsyc1P5OF37QDlUBmg85DQHMH6eA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p8UEHU3y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p8UEHU3y" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6C1EFC32782; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=TDgN44IgZI0RwUH7i/HAFVQMVhgZp3akiVjvMGhwalc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=p8UEHU3yXtYwgypz4M4XO9vIxESfTTl3XQRK0b1mfyTQGpSHEiEGI3SXavX3LiETS iAEFqL/mpw1/g3TVol905K5bpw0YgS5K6q4yV3zZjZET6nxE90o+BPJpXbHPFTWcCF v4PJWdqP06wOcsN0da9jq10Azb/mMwEyNY+y7prt0XsUQ2F3sg1Di3m4D/NI4g0J7B xOuxm0t2lb6bsxzsUvzxJXL31Dg/GDoNDcG4eRz2ZYN2y8+NHOc/7W95OhTID8fhES OdI7s2tTYxiU2sULjPo7fGAe+S/9mQ4jOVTXduT07/O5d/aWKT4EVxrO4yzqCnWUAQ UdYmkqx8KDsgg== 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 63E9CC52CDA; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:12 +0200 Subject: [PATCH 20/23] iio: adc: xilinx-xadc-core: use new '.masklength' accessors Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-20-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=1223; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=scLE0UCeIsTTRIkD5FhFjjiMruTUs4kHDToEaMN+2fA=; b=fPUYTrXv9f+DbYcT3DuLtq1kkiqy0vvvUX2/HLQS7pe71YnjlgXn/aXKkrDQj0QtC4Y1KNlrc JJBBK+55QndChONkflxjKr/JbhgcUSRJIzOJYlFQT6YpbaelHO2Qo5X 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/adc/xilinx-xadc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 564c0cad0fc79..cfbfcaefec0fc 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -628,7 +628,7 @@ static int xadc_update_scan_mode(struct iio_dev *indio_dev, size_t n; void *data; - n = bitmap_weight(mask, indio_dev->masklength); + n = bitmap_weight(mask, iio_get_masklength(indio_dev)); data = devm_krealloc_array(indio_dev->dev.parent, xadc->data, n, sizeof(*xadc->data), GFP_KERNEL); @@ -681,8 +681,7 @@ static irqreturn_t xadc_trigger_handler(int irq, void *p) goto out; j = 0; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { chan = xadc_scan_index_to_channel(i); xadc_read_adc_reg(xadc, chan, &xadc->data[j]); j++; From patchwork Fri Jul 26 08:23:13 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: 13742482 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB05178388; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=nSui+KbkuRGqPztjazn5Miz/J3tOJEcVNM2KJhTU1ihwEa194fAFHVQHtLpH+Tj8TglGtFJMOb7uRwc1QWgoWy+Kte7P4NbI3jq1Cjcw5oiNCwTnWeKNzQojtzjHgHXd5l93vknJUtFLpBoXg46sEeC4rwDuqUYiO7pFi/NWEWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=KrQFhJf8FJDPGFqDrIHncRfLunmp581qO6wFP16R3JY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=acD6OxTnKEiaOZ4FqPfc+y8ZVTGUrY1WAZ2pOsWnzTG5FW77UxKhh9nxgFlOd1TaawF6YbhCKZD8Mq/rRLsY5w4GnLXz6gmXlE+Ixg3RAeheL8ykLbwhkiZNgT1uwAv2Kg65eSQPTR0eDgEXSQETs8Hh9gzuIxStd8agnVcnAlM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PuHaNQrC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PuHaNQrC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7B105C4AF1D; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=KrQFhJf8FJDPGFqDrIHncRfLunmp581qO6wFP16R3JY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PuHaNQrCNsmECy4xAHjFIzgKYFpcWU8bSSJLeoqCWD1RpOhVTD8wAEo/Vy9kI3cho mE/2Q3GJci70m2mM0LMSY0hbKIE5L/S+RxVehvPtgs+KnVdV6wq132ISQu4o1BMwjZ 7uRocN3i2xps6GfA1T9RgH/l2TBrJoNQNXZiQ+BE4y7NxQ7vY7ea5ymNLiAMmBWndq /K3zXbKhx3J8N/zsmS5TNyy8HKfTPwyjRkfKWyDTpYbS1qLi6xlsBwFhrRErXha2mZ eYLh66ZFqDTTb+UFwWawgQbFQMDTP0xpD1wqOXO2kc11bSnjSqv+wNrzVHNtBtLj4F 2is6kOyIs3kdg== 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 710B1C3DA49; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:13 +0200 Subject: [PATCH 21/23] iio: common: cros_ec_sensors_core: use new '.masklength' accessors Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-21-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=1662; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=S8zIGb8Q4J9OHT5HsG9OinrLXTwNMakjT8op5GXXE1Q=; b=NK1YNz2usGK6ZYEbW1KxXqE/y+5B8S9jPIFusiFf8GoS2xQqvs/foDTlHzqAb+wzExuDIJ4Cd Jf4LQ7byffkCFvUqaIcW+M4XkU2ITSkc9AVnPhiLqqd9hXJVqAXKYgU 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 Reply-To: nuno.sa@analog.com 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 --- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c index 6bfe5d6847e75..9fc71a73caa12 100644 --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c @@ -198,9 +198,7 @@ int cros_ec_sensors_push_data(struct iio_dev *indio_dev, return 0; out = (s16 *)st->samples; - for_each_set_bit(i, - indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { *out = data[i]; out++; } @@ -587,7 +585,7 @@ static int cros_ec_sensors_read_data_unsafe(struct iio_dev *indio_dev, int ret; /* Read all sensors enabled in scan_mask. Each value is 2 bytes. */ - for_each_set_bit(i, &scan_mask, indio_dev->masklength) { + for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) { ret = cros_ec_sensors_cmd_read_u16(ec, cros_ec_sensors_idx_to_reg(st, i), data); @@ -683,7 +681,7 @@ int cros_ec_sensors_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->data.data[i]; data++; } From patchwork Fri Jul 26 08:23:14 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: 13742483 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A896117838B; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=BMYDZxRo5DFill194hCUVkVYds6yoyrfxi21VnnXhKmfQ7jfToO4B73gspRHMli4yR5SyDNLLE6RqUpQyHiFtlcmZ94e75WY1mj1pUwYuCb1m3i7zsBBpsA0V/YqNVJQQytwZ9zDtD9V0YESs8/ITl64f3g+T+rYivsBzT/UV1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=Fc89Zo39U5XhrFVqaThzOFPguhMAMPRG63FLoUPJGow=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k3CzR9VoszwQ54TPF42//paCayMQew6Ef36o5m8jSI+AVohfCSPAMxTFdWljVksZVD2Abw9DfeYdTEVp8XNFBAB9Tkb3vAcGK18pIIUr8PWpoYRfgCFhkeHAWNMF/M3zA+3bmEHUblc4G1+NNiUtRn/kiVMdwnceIsTQBSa753g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HNqUyaS6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HNqUyaS6" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8A3BDC4AF48; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=Fc89Zo39U5XhrFVqaThzOFPguhMAMPRG63FLoUPJGow=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HNqUyaS6B8ouep6bbc/kH4LI5cd3oU9FkC3LhNzHnaeTvKIUm0DahqV7nO6UUZDzr 8Ee7nq1o+gIbSdlxctn5dInk3IHrEvrhni/H6B/nuuy8UoSb0Es2O/q3ugXmjlrVfR KZ/Yh116Qbk/IHj5GvdJQVU//Hj0Jg6RpJYxs1/bxFVFms0Runi1D9phzQfQE0Nsgl tHWdtfGcqKaSkHKaejujes3Gmm1V228NzSiJ/7g9CJ+NkL+rl0KeiReykV0MGME/Vx 32YuvkbnQJBXo7aCuQjnQH2ZSsszaGPs1LhMCyk3jFgVARLh0JZtZi2ZkLGCSNxXD3 2jo011z0cWFyQ== 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 81ECAC3DA7F; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:14 +0200 Subject: [PATCH 22/23] staging: iio: impedance-analyzer: ad5933: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-22-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=1330; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=c0I9qL0LI7awsPlfCnHRYsDuN3fDHd+WekusA9Lsjrc=; b=HamDoKKSvrVM8qMEmKTUmqg2UDsVU3dhHUw4FVGu6oOJp0Ox0ewjR6RrydWg7g6SvnB30CgS3 nI/mcpH3syUD7fsXKguvB30O3QbtVQmbmeVIJn2Eo4ZQokppKynGUaf 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 Reply-To: nuno.sa@analog.com 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 --- drivers/staging/iio/impedance-analyzer/ad5933.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index cd00d9607565..4ae1a7039418 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -547,7 +547,8 @@ static int ad5933_ring_preenable(struct iio_dev *indio_dev) struct ad5933_state *st = iio_priv(indio_dev); int ret; - if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) + if (bitmap_empty(indio_dev->active_scan_mask, + iio_get_masklength(indio_dev))) return -EINVAL; ret = ad5933_reset(st); @@ -625,7 +626,7 @@ static void ad5933_work(struct work_struct *work) if (status & AD5933_STAT_DATA_VALID) { int scan_count = bitmap_weight(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ad5933_i2c_read(st->client, test_bit(1, indio_dev->active_scan_mask) ? AD5933_REG_REAL_DATA : AD5933_REG_IMAG_DATA, From patchwork Fri Jul 26 08:23:15 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: 13742484 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9DF917838E; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; cv=none; b=q49eS38GJhd7oWhBvqM8noSpkiseEXuNQ0HSSfsc779esg3zL560yAXuZ67hCHRAVBXwuMj3qDUwnfuuwmlPdcb008w6S0OKqU26fIhdAkOIk81rpoCmNv+7rqH8zMc3XOlh1oU/D3gTlncDUphHwqeH3m8LhzPQthsyOoUDvj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721982181; c=relaxed/simple; bh=e1JekgmyZG6de3n/s2PZl+MtdBPsp4Mjb0OhK+wmryo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ncWwOTkIfyI8win30NOxsvM/dtoBP4dl0CRCPFUMq+6NKINeFEbrbVhB2fVTsO3brt4lANx8e4vPpvSQOABEpuGnKSJanaBXklymI7SfCHZp6jx3oQR2MhnT7pi0TTOQ3gPyXH5J5wZTChHVyhcAuv91Y1aCqsM8W62i7wxNiTY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bbRw6Amg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bbRw6Amg" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9860BC4AF0C; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721982181; bh=e1JekgmyZG6de3n/s2PZl+MtdBPsp4Mjb0OhK+wmryo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bbRw6Amg2U2t72MfzD5xAXm4xycNjIOGj/I9TOGXpW4OWE2qIOClDHHVMehZWbApj icOu3CYJirK6mHGCzGGhXXjicb/3VSzSIJtZo6c8aj3ZUILId6khaNhuFqe6vxqWYZ 5kSWXhvj/EvSnkRUG/aU+acr6mYFZpVaDagSMeKeHFIdYzZw4h6XvXs8f8iGAmBavv ogoE2n6KLBBa4zaQsW4h6xE6UVUtBfs8K+StLae0ghsCdmg9YsuTMBWXaRweJ2rI3U PD/wNlC0Ik0fXEY9KeeVqwU8ne1d2ReOAUFQlx97nAp48YrbjULOKA+5PJTMXE+PRq o9QxYydDKw41Q== 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 8E81EC52CDA; Fri, 26 Jul 2024 08:23:01 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 26 Jul 2024 10:23:15 +0200 Subject: [PATCH 23/23] iio: core: annotate masklength as __private Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240726-dev-iio-masklength-private3-v1-23-82913fc0fb87@analog.com> References: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> In-Reply-To: <20240726-dev-iio-masklength-private3-v1-0-82913fc0fb87@analog.com> To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: Lars-Peter Clausen , Michael Hennerich , Ramona Gradinariu , Antoniu Miclaus , Jonathan Cameron , Marcus Folkesson , Kent Gustavsson , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Maxime Coquelin , Alexandre Torgue , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Haibo Chen , Michal Simek , Benson Leung , Guenter Roeck , Greg Kroah-Hartman X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721982178; l=1709; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=j64bS8AlbPEaXDKOf/24fcP0//ABTNMV+H57fOfioL0=; b=SqZqmPuN3DkvmQIpd3N42mKg1nerY7jzP7iAtnBI7wcyiGwg8NfCTvLb+HIxSYWS2uqA7Xsk+ GnOcDRGd0Y7DoHUHxvqRqJiMfulWw0FRfgtpb+Y10pKwol9SoVNnfI1 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 Reply-To: nuno.sa@analog.com From: Nuno Sa Now that all users are using the proper accessors, we can mark masklength as __private so that no one tries to write. We also get help from checkers in warning us in case someone does it. To access the private field from IIO core code, we need to use the ACCESS_PRIVATE() macro. Signed-off-by: Nuno Sa --- drivers/iio/industrialio-buffer.c | 2 +- include/linux/iio/iio.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 3d0b1d25fdd7..8104696cd475 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -2269,7 +2269,7 @@ int iio_buffers_alloc_sysfs_and_mask(struct iio_dev *indio_dev) for (i = 0; i < indio_dev->num_channels; i++) ml = max(ml, channels[i].scan_index + 1); - indio_dev->masklength = ml; + ACCESS_PRIVATE(indio_dev, masklength) = ml; } if (!iio_dev_opaque->attached_buffers_cnt) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index dd6bbc468283..f6c0499853bb 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -609,7 +609,7 @@ struct iio_dev { int scan_bytes; const unsigned long *available_scan_masks; - unsigned masklength; + unsigned __private masklength; const unsigned long *active_scan_mask; bool scan_timestamp; struct iio_trigger *trig; @@ -861,7 +861,7 @@ static inline const struct iio_scan_type */ static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev) { - return indio_dev->masklength; + return ACCESS_PRIVATE(indio_dev, masklength); } /**