From patchwork Tue Jul 2 16:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719965 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 7124D1BB6BC; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=ZsN4WDlo/Ih/oM3Nbcir1cgpy2PKWEEbnrVr2mn4O0LymPg1pkmYo4gXnb8OptP+tG0E+7Bav3xloIMzG47pDJfVaeVdOe7lxc1TQ5UfuzUnRAYq9GeHETGgV2JpHSRr9adUJNEkBQxdlZ1tYF38ZCbC3Rvnx8JkyetETRxxp5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=X9U2RqNBvqNInuBI9oKZcFsFepJn/tehK2K25jnqvTc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bHZKuUw9KiRHZXjySw5bazix5uCKcUHtUza16YrCWWaQwW/P1O0bnHeWepacmIwBFbL3w1hzQANeIhfqiW1dRCKTbkQgtzJIbDXxtYXPj9nR6tWb+9x7waUq++7oqEFj3k/Xhi1/K25BIjP0O/4BXd2XCvpXQjd4gu51njZkFhg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bemJDZw+; 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="bemJDZw+" Received: by smtp.kernel.org (Postfix) with ESMTPS id 13677C4AF0A; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=X9U2RqNBvqNInuBI9oKZcFsFepJn/tehK2K25jnqvTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bemJDZw+qLgJsnubBLLySuI0flI8N6XRBymD0l44shxoUyB4GuQnbBCWOrXjkP/mN ezzakjbZWke3Dg6HsD380rRn3XK0SGdBoKriDScl2wxZRbDBgDvjeqqNcq3PC+X2fx DCT+GuZECD2BlIdX2fIxz4FDXl7HJ8A6faOlVARtKNQHIEzxtUjg5N92mG+BMwcuTg 70Htz45XYPEfb6LGZfVE5GSQ/OxV+WQzwvmRExHJsZoFa/eQ+O5qIlTfeEVhIv/AV3 1QBrnf5NkklVwIf41REFxGym/7LEGqPdbFyScqXH5XhtkXHIbrtkXJKKZj3u1gnPC4 UDjtuJkjcZNvQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1AF8C30658; Tue, 2 Jul 2024 16:02:38 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:33 +0200 Subject: [PATCH 01/20] iio: core: add accessors 'masklength' Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-1-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=1677; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=EA7SSU5JCACZ9RbuyelW015qMw9c7NJ9Gp/LUGrm0oI=; b=WOeC8On1W5DCuG3LfamYH01OA5F0KKWMc0DWI3AWAeSbOQx46FElbbhV4CKkRfZy3+gYMQqWC lf31gWkzbbECs1Z5B21bh3N363YaVGrn7aRYnhS2HeqXObSmuYw+cFY X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa 'masklength' is supposed to be an IIO private member. However, drivers (often in trigger handlers) need to access it to iterate over the enabled channels for example (there are other reasons). Hence, a couple of new accessors are being added: * iio_for_each_active_channel() - Iterates over the active channels; * iio_get_masklength() - Get length of the channels mask. The goal of these new accessors is to annotate 'masklength' as private as soon as all drivers accessing it are converted to use the new helpers. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- include/linux/iio/iio.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 894309294182d..dd6bbc468283e 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -855,6 +855,24 @@ static inline const struct iio_scan_type return &chan->scan_type; } +/** + * iio_get_masklength - Get length of the channels mask + * @indio_dev: the IIO device to get the masklength for + */ +static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev) +{ + return indio_dev->masklength; +} + +/** + * iio_for_each_active_channel - Iterated over active channels + * @indio_dev: the IIO device + * @chan: Holds the index of the enabled channel + */ +#define iio_for_each_active_channel(indio_dev, chan) \ + for_each_set_bit((chan), (indio_dev)->active_scan_mask, \ + iio_get_masklength(indio_dev)) + ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals); int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, From patchwork Tue Jul 2 16:02:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719966 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 879471BC096; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=iNDEhfvaU12oXTpAJ0femiedqmX5whXh0bNCHyXFGZvYRRLssdgdiJ9Jua5lhrqRlRrke9mmOWi0hpIdYq0HpwvfAIVMtEAlyq7ScL5efPoW9VckcYJ8xvNnAcUvwKN5GbZuS2H/cwjGARSthv2e9EqyPyo9w/7tNWxuPXKPc3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=ihOzVGJqm0d6Bf+2v8BGqtXAu3mpTzxXVeZwgRlF1Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AUvSwG0IL2c/ayg+v+c3r1G4buYnqdU+s7oRNNwO70DI/45s5ZFiwx2+QmZchZ6f34WSeg3skRKN0+ErAA3bP9DTwAh6Ap38EjwkRsQfbU8B/qa7tXwn4UPswejko3dwRcKK7hptl0agDcVkGjElvVdFAsPWQnTZjOZ3qa0pkkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cGuOy2AE; 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="cGuOy2AE" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2429FC4AF07; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=ihOzVGJqm0d6Bf+2v8BGqtXAu3mpTzxXVeZwgRlF1Mc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cGuOy2AE08q77TRgAM5guB04jdSAG1x2AN/lrBk+xF9n/RVcKtjtzIB0fM6BJosrF ZA06zsWpE/FlxZX3Jc9kCnENk5/PUhMnUfK4TOQG+V0jpU2Ko+pnuCEk4jmyzSdu9d EdHjYTN+XEr+4ZLST1iclSyyJJWwfErlVxdIQfSgATSg7U+id/xPQZhtMOdXwMJFBU 4pxBd49SNw73EzjWAknnoq1+93obLJ3DHlD8gPJ17cCj+sTlp/jYvTl5I3iGber6vP cJHOeYRO5OdJkZV4EV4I5E182HJP0D3MDm7url8LH8hfD3qbL7asrsOr26mpNShkup JHebQSwf+uLNg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11C5FC3065D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:34 +0200 Subject: [PATCH 02/20] iio: core: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-2-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=787; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=q8IX5Pt5A6KGno27QoxN2X3k3j64RKvI5e+ShjWeyFk=; b=ssQKkLuKZ5MrR4JWpkmj+KsOh1I/ZpdqwlW13UWmcM9OVrQdUyCjMgixEpP0nWba20kAbq0P8 vrxtwleODJGByn7di9rpyaB1q/aljuXsXM+tXlAhZJwcxpFg222xGmX X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 2f185b3869495..e392a10aaf320 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1907,7 +1907,7 @@ static void iio_sanity_check_avail_scan_masks(struct iio_dev *indio_dev) int i; av_masks = indio_dev->available_scan_masks; - masklength = indio_dev->masklength; + masklength = iio_get_masklength(indio_dev); longs_per_mask = BITS_TO_LONGS(masklength); /* From patchwork Tue Jul 2 16:02:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719963 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 58A551B47D0; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=NHTJSJhKRF0rN55b4zzDLzpnO165XQhiH3/14Or4KdQsP4BPt0ljumFUmdCTPojfHzYQOu2ohz25i1KT/nIxBEFw05TmlTlCDYmRundtFfAZFDiTZH/5uBFUBeX1AgapFfME14gvGCIekcubBCbDyPfBwBM97cRxqDHtMUn1DpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=H6knCmshjK5jGEsidqg9p/dgF02XphFvTsPHqzn4WQw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d6gdui5iPeKfHXIuNCHYkmgw9qZP2BJgc7Ml+rFjVoELVpA92+KoxTzArmb5RPdbM0SJhKLrfVfjIZ+kGAwBNuHd8vGoqpLPIkqQ9i9O44/RZ/p1n9CQQqQAj9+SlFFn1XmIePWZmFq6D4SxM2etQP3wNIwVVs5d/Im8CEYd99o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B8ACQCOB; 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="B8ACQCOB" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2D908C4AF0D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=H6knCmshjK5jGEsidqg9p/dgF02XphFvTsPHqzn4WQw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=B8ACQCOBSeXAMiWqKyyqtsTCs74VAAHr503UAPluDfd1+Ch9KQW1z4c7ILOQy72E+ qRT7aPuRAuLdaqchknQHgetoXFjBbhGS1cDXg6tc8uE//VsfwpdfRjVA1uegXLmhRr SZJ/r1jJjiJmX7EF80VUJIL/oJRRcqbcTWeJJxpBq6CkelmfK3GK3Smxlwg2baHKmk Q3X0DZeLJc21GI+YTzCZ2wP3gpDgHn1B4ZHyT04Ly5u6wcRJ6OvDu6iZeLmKlxlmSl 9nKGpc4oKhncgjOlgiFUYKXYP42H1QgIwqTcpeccj6KJlQQas1FwriZR1w4FvGoow/ U8v74wm39pdEA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F9B7C3065E; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:35 +0200 Subject: [PATCH 03/20] iio: buffer: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-3-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=8943; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=U7dr1egZgx9NyisqCoR3KT604oyD4R25bPaOlNgH5Bg=; b=GJ1AZCX6hZqMIVksHzM6CH1VBok4DW6f0RMeoXqxnKC2jOlLABH/eJIND/PEHVWvtyddGVxTV LjVguhviQOeA7/zdTDikSWTmyzmmqGOdJEPwuoReCfjpCo6L0VhKQYN X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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. While at it, remove some unneeded line breaks. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-cb.c | 2 +- drivers/iio/buffer/industrialio-hw-consumer.c | 4 +-- drivers/iio/industrialio-buffer.c | 50 ++++++++++++--------------- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c index 4c12b7a94af59..4befc9f55201e 100644 --- a/drivers/iio/buffer/industrialio-buffer-cb.c +++ b/drivers/iio/buffer/industrialio-buffer-cb.c @@ -77,7 +77,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, } cb_buff->indio_dev = cb_buff->channels[0].indio_dev; - cb_buff->buffer.scan_mask = bitmap_zalloc(cb_buff->indio_dev->masklength, + cb_buff->buffer.scan_mask = bitmap_zalloc(iio_get_masklength(cb_buff->indio_dev), GFP_KERNEL); if (cb_buff->buffer.scan_mask == NULL) { ret = -ENOMEM; diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c index fb58f599a80b1..526b2a8d725d1 100644 --- a/drivers/iio/buffer/industrialio-hw-consumer.c +++ b/drivers/iio/buffer/industrialio-hw-consumer.c @@ -52,6 +52,7 @@ static const struct iio_buffer_access_funcs iio_hw_buf_access = { static struct hw_consumer_buffer *iio_hw_consumer_get_buffer( struct iio_hw_consumer *hwc, struct iio_dev *indio_dev) { + unsigned int mask_longs = BITS_TO_LONGS(iio_get_masklength(indio_dev)); struct hw_consumer_buffer *buf; list_for_each_entry(buf, &hwc->buffers, head) { @@ -59,8 +60,7 @@ static struct hw_consumer_buffer *iio_hw_consumer_get_buffer( return buf; } - buf = kzalloc(struct_size(buf, scan_mask, BITS_TO_LONGS(indio_dev->masklength)), - GFP_KERNEL); + buf = kzalloc(struct_size(buf, scan_mask, mask_longs), GFP_KERNEL); if (!buf) return NULL; diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 0138b21b244f0..389bfb238b510 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -473,18 +473,19 @@ static bool iio_validate_scan_mask(struct iio_dev *indio_dev, static int iio_scan_mask_set(struct iio_dev *indio_dev, struct iio_buffer *buffer, int bit) { + unsigned int masklength = iio_get_masklength(indio_dev); const unsigned long *mask; unsigned long *trialmask; - if (!indio_dev->masklength) { + if (!masklength) { WARN(1, "Trying to set scanmask prior to registering buffer\n"); return -EINVAL; } - trialmask = bitmap_alloc(indio_dev->masklength, GFP_KERNEL); + trialmask = bitmap_alloc(masklength, GFP_KERNEL); if (!trialmask) return -ENOMEM; - bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength); + bitmap_copy(trialmask, buffer->scan_mask, masklength); set_bit(bit, trialmask); if (!iio_validate_scan_mask(indio_dev, trialmask)) @@ -492,12 +493,11 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev, if (indio_dev->available_scan_masks) { mask = iio_scan_mask_match(indio_dev->available_scan_masks, - indio_dev->masklength, - trialmask, false); + masklength, trialmask, false); if (!mask) goto err_invalid_mask; } - bitmap_copy(buffer->scan_mask, trialmask, indio_dev->masklength); + bitmap_copy(buffer->scan_mask, trialmask, masklength); bitmap_free(trialmask); @@ -517,7 +517,7 @@ static int iio_scan_mask_clear(struct iio_buffer *buffer, int bit) static int iio_scan_mask_query(struct iio_dev *indio_dev, struct iio_buffer *buffer, int bit) { - if (bit > indio_dev->masklength) + if (bit > iio_get_masklength(indio_dev)) return -EINVAL; if (!buffer->scan_mask) @@ -733,8 +733,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, int length, i, largest = 0; /* How much space will the demuxed element take? */ - for_each_set_bit(i, mask, - indio_dev->masklength) { + for_each_set_bit(i, mask, iio_get_masklength(indio_dev)) { length = iio_storage_bytes_for_si(indio_dev, i); if (length < 0) return length; @@ -855,6 +854,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, struct iio_device_config *config) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + unsigned int masklength = iio_get_masklength(indio_dev); unsigned long *compound_mask; const unsigned long *scan_mask; bool strict_scanmask = false; @@ -863,7 +863,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, unsigned int modes; if (insert_buffer && - bitmap_empty(insert_buffer->scan_mask, indio_dev->masklength)) { + bitmap_empty(insert_buffer->scan_mask, masklength)) { dev_dbg(&indio_dev->dev, "At least one scan element must be enabled first\n"); return -EINVAL; @@ -917,7 +917,7 @@ static int iio_verify_update(struct iio_dev *indio_dev, } /* What scan mask do we actually have? */ - compound_mask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL); + compound_mask = bitmap_zalloc(masklength, GFP_KERNEL); if (!compound_mask) return -ENOMEM; @@ -927,20 +927,19 @@ static int iio_verify_update(struct iio_dev *indio_dev, if (buffer == remove_buffer) continue; bitmap_or(compound_mask, compound_mask, buffer->scan_mask, - indio_dev->masklength); + masklength); scan_timestamp |= buffer->scan_timestamp; } if (insert_buffer) { bitmap_or(compound_mask, compound_mask, - insert_buffer->scan_mask, indio_dev->masklength); + insert_buffer->scan_mask, masklength); scan_timestamp |= insert_buffer->scan_timestamp; } if (indio_dev->available_scan_masks) { scan_mask = iio_scan_mask_match(indio_dev->available_scan_masks, - indio_dev->masklength, - compound_mask, + masklength, compound_mask, strict_scanmask); bitmap_free(compound_mask); if (!scan_mask) @@ -1005,6 +1004,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer, static int iio_buffer_update_demux(struct iio_dev *indio_dev, struct iio_buffer *buffer) { + unsigned int masklength = iio_get_masklength(indio_dev); int ret, in_ind = -1, out_ind, length; unsigned int in_loc = 0, out_loc = 0; struct iio_demux_table *p = NULL; @@ -1016,17 +1016,13 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, /* First work out which scan mode we will actually have */ if (bitmap_equal(indio_dev->active_scan_mask, - buffer->scan_mask, - indio_dev->masklength)) + buffer->scan_mask, masklength)) return 0; /* Now we have the two masks, work from least sig and build up sizes */ - for_each_set_bit(out_ind, - buffer->scan_mask, - indio_dev->masklength) { + for_each_set_bit(out_ind, buffer->scan_mask, masklength) { in_ind = find_next_bit(indio_dev->active_scan_mask, - indio_dev->masklength, - in_ind + 1); + masklength, in_ind + 1); while (in_ind != out_ind) { ret = iio_storage_bytes_for_si(indio_dev, in_ind); if (ret < 0) @@ -1036,8 +1032,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, /* Make sure we are aligned */ in_loc = roundup(in_loc, length) + length; in_ind = find_next_bit(indio_dev->active_scan_mask, - indio_dev->masklength, - in_ind + 1); + masklength, in_ind + 1); } ret = iio_storage_bytes_for_si(indio_dev, in_ind); if (ret < 0) @@ -1646,6 +1641,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, int index) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + unsigned int masklength = iio_get_masklength(indio_dev); struct iio_dev_attr *p; const struct iio_dev_attr *id_attr; struct attribute **attr; @@ -1708,8 +1704,8 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, iio_dev_opaque->scan_index_timestamp = channels[i].scan_index; } - if (indio_dev->masklength && !buffer->scan_mask) { - buffer->scan_mask = bitmap_zalloc(indio_dev->masklength, + if (masklength && !buffer->scan_mask) { + buffer->scan_mask = bitmap_zalloc(masklength, GFP_KERNEL); if (!buffer->scan_mask) { ret = -ENOMEM; @@ -1879,7 +1875,7 @@ void iio_buffers_free_sysfs_and_mask(struct iio_dev *indio_dev) bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, const unsigned long *mask) { - return bitmap_weight(mask, indio_dev->masklength) == 1; + return bitmap_weight(mask, iio_get_masklength(indio_dev)) == 1; } EXPORT_SYMBOL_GPL(iio_validate_scan_mask_onehot); From patchwork Tue Jul 2 16:02:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719969 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 9DDBD1BD00F; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=hXB4pBouOVtoyUnnv69CErXkHASoJuvC9yvqS9pLY/PoxPDX321fOD9jMfP3E69vQ7fsLN78BeVywIl+1gGFAVx/7l44JltL4B6juga59NZbJyIgqwf7JdHema52CjCsHcAHk9IonQNYHJrEjAiCcs/I6NhRgYZ9uF8f3ec6Ak0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=RaueGeC+jGBMTdCacPR+kb1XmqOFJE7ZrTneACLbmpE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lExbuTXCLB7Nv0ZWM1Y/3MLDPOzKgU2k/MgcSQ03VGg/IxYM5bt4Szp+465VvdwYMU2XeCJ8ZeSEx4Tn+Clt3Wm0frtZpOpGlDGVQsNze/EXwDPhj/valVWjYxnXSaUsIcXbG3/VUC99HMpTbHr0b847wnh/KFvlDlxFUpN1IRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HifFKV1f; 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="HifFKV1f" Received: by smtp.kernel.org (Postfix) with ESMTPS id 370B5C4AF10; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=RaueGeC+jGBMTdCacPR+kb1XmqOFJE7ZrTneACLbmpE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HifFKV1f7zIRt7LFHBSCXcJcLG+fe6E6yersqY97MhQZ6J+yYfDjvnkDyhIoSnsvX huT0ZuavwxfIjRt/sN0PZnTsV0L9Ln80VyMiz3Amw4lq6VUufCYFVqy+Mxcah9OLYd IhNpEF86n6MQhcnzPPeLgk3fPYKsfdSA+9HxrLgTtPgNfX9JgIHD/BAR1IMUGbz7kJ SHmEqbxZ6pDVp1R+kAJeC8FY8HOHr0qo4rVAe5TOdf9zshDh34k6aHIvrnQPzcUlij 500wsqGBIcxhS/4IdvlwIl08Jb6WGclESK6hdbtSMIhyx4hBsR+E6/1C4AEIL8Qp4/ YkBkTHm/Wc2rg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E6EDC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:36 +0200 Subject: [PATCH 04/20] iio: accel: adxl367: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-4-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=721; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=f4PVshteDVZAwqATinUZmA3UwIta66xyxWFMtEAfYQg=; b=1jd1tko8JTt6ombBnrwWcAZplN7C74Nu1r8Ua45+V5Zh5KiUAiJVG3T2zgTbf3ehU5XCQW62l Tn8hVu93D49Apu1X0TW0t5tEspUjaokc84rDXaGMUk7V4hl1ov/rbc4 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/adxl367.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c index 5cf4828a5eb5..1c046e96aef9 100644 --- a/drivers/iio/accel/adxl367.c +++ b/drivers/iio/accel/adxl367.c @@ -1220,7 +1220,7 @@ static int adxl367_update_scan_mode(struct iio_dev *indio_dev, return ret; st->fifo_set_size = bitmap_weight(active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); return 0; } From patchwork Tue Jul 2 16:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719970 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 9FAF41BD010; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=JrhQ7QJnidydyCkaBeyptHc+gDQRAr20d1aiKFzYYT7SWi2uDuY8o3tjtxbKkzHAnonIioXizH8wxSoZUCfCEFeWkAOHNj+sZ/I9kb3/8ZCgLILwd5qkClLjKP+1xgu7gOS1uTFu+aehLlPlr5rwk8ZcH0n/kMP8xDpa4lKpacw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=P006j2vq5FFKg/037/BLpRC4GtOGeEzgy0ToSf1ZAxA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YDykp6/arAflUE3/r7e5OuqbKyBfrSoXHxhY3M9vMFko58dhzzzcXGO0NLHu95jslvTTyRyyl1aNvmY4q+EiuReuqf5PEBpvyTZqXNTP3/8O4LjDvG/u1zhRCYyR0UGtVqN4YHZF5ayoqLP66Q+JNGlMyU+4yInZRfGaDlwVpjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gIsEo9gl; 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="gIsEo9gl" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4D2DEC4AF11; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=P006j2vq5FFKg/037/BLpRC4GtOGeEzgy0ToSf1ZAxA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gIsEo9glS+gXg1z7maaeNX+13nZHc61CxOwODQT7E12lj9txYWFqDf4icUQTQfKNr 2vvGxo4eVCB6pEVmpZY99BHF4MyvARBKhQUglcCT5gcW6U7t4nkRgPTiqhwip4rkx3 y7BywhA4gN3G9Zw9LzufTORjfveze6vrK0OVhnxVAX4uQAZCU5+EP7nPjattNdlOjh UXniKAg6FRHOpVaT0IXYUN+fFS9464JWlM6zML6qIMjl3eqvpwnFHpk/XRt6N2s9fL mfSh6NbsE3TvjtpuINAXxLNK6oAAkOl0fyQOxGIocvFrX+ld2+l2oojYDxE6N9vEma BccjmyXUmYC5Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FA36C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:37 +0200 Subject: [PATCH 05/20] iio: accel: adx1372: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-5-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=915; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=2EHdpJoQbj+k3J/CWxWS22/x7Zsq5ayA38mR5vpDteM=; b=HqGJD3hvrnZvHwYeCHrVGiJTDHQ7E6p+zcjNhkmu9gmiIdn8ADUJohk+uNH00HrlnzDF3XAXL +0ew+gitwztA3oLuTgEsLnowhzmOXwPzxz0T+g+HI0QTHeOapeqk/uh X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/adxl372.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c index c4193286eb05..ef8dd557877b 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -1050,7 +1050,7 @@ static int adxl372_buffer_postenable(struct iio_dev *indio_dev) st->fifo_format = adxl372_axis_lookup_table[i].fifo_format; st->fifo_axis_mask = adxl372_axis_lookup_table[i].bits; st->fifo_set_size = bitmap_weight(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); /* Configure the FIFO to store sets of impact event peak. */ if (st->peak_fifo_mode_en) { From patchwork Tue Jul 2 16:02:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719968 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 9D7CA1BD00B; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=ui8yubEu8687tVh/1PTxU0Jx+dvDp/Rl3A98h7JC8qC/XCJEW1f683AGO3XP5uG19prrRQUmRHUkbR9F++Gi7YEyMoF/GepMHVhYKvgOO1/ZWLUz6+4CAk0AdS7K/QnWa4aShUrItN5/qAdCN6u7IRw8brtaxyJ0e02YPLW91uU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=xVxyFNnUOQfVYMK63TbRRb8qAbFJCDubROXQiuFnah4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RjWf/EWABLQV8WBZKnh5kJ3E6gR37lVi35eAMpMHdLGssiiVdql702YmjeoWO/WbuBwmgXYbjFuo7Czgj2BMAp94NLCceQp06QY79ueU3Nj/iLtjj8KSK3SHZG8b1H64DxkCdJvz6vr4ztE3jzf9AMmVVmOd0UrHRRFo4R4k50k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZQZWwVx2; 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="ZQZWwVx2" Received: by smtp.kernel.org (Postfix) with ESMTPS id 56C86C4AF13; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=xVxyFNnUOQfVYMK63TbRRb8qAbFJCDubROXQiuFnah4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZQZWwVx2YXn5Syk2PbUyJCw75rbwjjtC4lW3XJX5qh4WdtutMDDht2L2tTXeo6Nv1 DtRXewhesrqNKXOf6l7+Rt4sxv2qCzHVuTrOunueV4EGPHuG+tLC6UB/odygk7+Cv+ 6P1PtQ55FhyVD8fopiuaUXmmzxOGfxH/lQC+kQOMNMGJlffzsMWOG+nCsE3BEgGTbL xcFBhjf8jZ7ZLBSInPdpKP5m1NaZYeTzUKUkaMSSfS1KSQoF48Q+kPJlWFnMnwh55A mIIuDjY3al+roxjtn3Ey9DwzG9zpLAM4lPruROiBv2yXIARR1f6raLAVf6jTnepp6j P9qxKJ8SJpQxg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E1ACC3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:38 +0200 Subject: [PATCH 06/20] iio: accel: bma180: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-6-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=852; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=cf8nH+C7ga2MXuJGs1LhW+Vpw2HhW0TtDxm5BRQV7AE=; b=uqji2JCwXdfwSMPdRVcuAb/d2Dl34B6/KSFtjmrqUxMgkRWE3YlbPtvfqbNr5hbh197ihNyIa +mYYUYZi9KLAkXqmYe/W6FDoDUOXPleO9cilkhT4a4DzC44FcRaDbeh X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/bma180.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 6581772cb0c46..2445a0f7bc2ba 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -876,8 +876,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p) mutex_lock(&data->mutex); - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = bma180_get_data_reg(data, bit); if (ret < 0) { mutex_unlock(&data->mutex); From patchwork Tue Jul 2 16:02:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719967 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 9A3C21BD008; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=SR2BRenbNLhhQVuwqgXuc2/S1kYFI3wReBmMBrwAhWyxcNlZNYnycv0qzpnT7G8dk5tvAg0247CO4sasJjEKrR95bwHpHFGNiCGes2XwIVnhdLL9hRuKGesmKccBhdHBgfWExHmNw4+iLq1FZf8xtrFUBtqDeRxYZC2tcKzVK1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=HiXT5JNAR/1VnVUe+f4ZpB2y/EtlWF8H9g7WziIDIOk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tPB5usl2DwmDqh/mCTM7euPwl4Q+ReIlDJGQA4nIzzm3cj3XTwXkq8s4APIoNXPjlP1tB0a5ntRwpOq0XyaCSH+MaZxzb6OuiZCVwGsRgKgIKPwGL94SmkwrEmJ2/vH5hGsAUJCckoeIU6zfhsU93FQFeB/i3S0y7KjEJDIT9lM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g9zkoQwc; 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="g9zkoQwc" Received: by smtp.kernel.org (Postfix) with ESMTPS id 62CE6C4AF15; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=HiXT5JNAR/1VnVUe+f4ZpB2y/EtlWF8H9g7WziIDIOk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=g9zkoQwcrhJCIJbGkZ2UnJ2K6vM5cQ5NT1hwVFH1T4YYHPFWPhGrxMtZgOvxipKzv B4ufyTGUezxkTuIpeBcVrkUZGo9FF1gtu9MZLH0V+wLhze+SI8uP8HyBkfEPanA5wb qayOlb/pZ+qRxMK/WGRwSqgCgY7QRfpKF5seY+ozhwqndUjCQuVO/ewSbceCQLMS/O bvAYkEuoXob1XiWpzWLKzXBBVidgSR7eOJVq9xqVx33/WuCkOsj2eDJ9raqT4iOOCb l/O2CVbYXpwqgKlnA0XHL3+PafonA+nvnnHn8FQlJQ47/QJdzPQFfv/fDwTbUOj2BS 8WqN/hV0oyszg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B51DC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:39 +0200 Subject: [PATCH 07/20] iio: accel: bmc150-accel-core: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-7-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=922; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=JeCIOP4qgOR1Vu/Iu0Qe9nBtR5DIWcMVPhJ4pTpIOtQ=; b=/2w5q3UWgYNzczpKhdhjLtwr+/NVWDbhJ9/6z6VmYIYt6PsaG52LAInaeclbeVx47gtB/KIA7 Fg5QC9lLSHnDagmgywq6G+tpSSB5XobU6izlnRNijyC3zDtfltQ7gVV X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/bmc150-accel-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index ae0cd48a3e293..03121d020470e 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1007,8 +1007,7 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev, int j, bit; j = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) + iio_for_each_active_channel(indio_dev, bit) memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], sizeof(data->scan.channels[0])); From patchwork Tue Jul 2 16:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719973 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 BF6791BD024; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=EtdmPRjXYfnQOC2pa8DbmQEoUgOTSxWrCwmomgSVDRuscLrNwGuuEuWe5ySMrcM4alm5vAIdt049YccXe+OlqhUFEesY7JKPymMOecA7BEujOyMPXzWA4jRGxp6xcbZD7/sB6E17OVFujutXbL5wpe42HoDtkqHostENMhJrgiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=ZCwedfbQM7Bvz4eB/mWdYfk3xL/2GllIWFfaCMXiRTc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qfU8PxXvozKyLDDbN3uv7D2bP+YtKX8yjyPSw7XjdETYFML6hEQ24IWdFeU4qgxOqGnHgpAqtTNOJR1DWHG0BOvX9f5Vcw4J0J18LIZJXcrK+4rMNX1rh4YRBWuwb48fKNs4EZdnhHS1RJU01q7k5fcvb9YgIN9OnGs2e3EREAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GTa+Vub0; 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="GTa+Vub0" Received: by smtp.kernel.org (Postfix) with ESMTPS id 70445C4AF17; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=ZCwedfbQM7Bvz4eB/mWdYfk3xL/2GllIWFfaCMXiRTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GTa+Vub03zR2Z0JlaAuGVCX8zdkoTQI1fTWcZdCMahH6ij6zkAILRy+47B8/Gb0Ei +b/W+lNoDN3QapbENksnfctH0DMKvBteZhop3lqhhVsI5aEvPSN8KW4KLPxPXoP5Ne /n4N/0Nrf5BiFx0/uet82tEJuef2tAfKSJevMbz2CtLzxXJYAgr7sfQYxdOTb95MgJ lgGX6a3+66yQXpDP8Su8JmajILcpIvgjGpfemIq4gZxiEY0Qhmiah1yz6/ZR3bxE7Q gP72YhD18aXHpI6BKFg1WdziZDsEG8kQuulAg2p59k0HU0ot/M0t6r5g1lPwuu+TEP v8+zYd9wJflMg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A412C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:40 +0200 Subject: [PATCH 08/20] iio: accel: cros_ec_accel_legacy: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-8-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=856; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=Yooi1Y6tJJguy67GjA7GqDAjdHAGHhdREsMY2f86Dxo=; b=RBZcE+cYo3blVA2VGyLaJwUXflDQ6pPjo9mW6HflNYlGIxZLsMd2KyTAefDtDCYuqFOtd5yT7 dRU0tYawuD3DUTmtGjIR9BLFCxRsRdf/aghHELirnJcWyKom2CvKcEO X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Ue iio_get_masklength() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- drivers/iio/accel/cros_ec_accel_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c b/drivers/iio/accel/cros_ec_accel_legacy.c index 0f403342b1fc..f7e4dc02b34d 100644 --- a/drivers/iio/accel/cros_ec_accel_legacy.c +++ b/drivers/iio/accel/cros_ec_accel_legacy.c @@ -62,7 +62,7 @@ static int cros_ec_accel_legacy_read_cmd(struct iio_dev *indio_dev, return ret; } - for_each_set_bit(i, &scan_mask, indio_dev->masklength) { + for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) { *data = st->resp->dump.sensor[sensor_num].data[i] * st->sign[i]; data++; From patchwork Tue Jul 2 16:02:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719972 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 C02C51BD025; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=ICX4ARqswth4V2SmLlyb/XaXYcUPa+5HFmDNeBHRzbDH9gWiBAjHPCtMXkCVf5i8t5XlwZsl8SSi1NlQ8LXWlDpBo+5dIyXqW7wRRAVlU2eXwCOvYTHQHXqpywNpi9oPN9Aq/jlvbd3KM82vc1Tlma3xRTPtpPB6lfIAKLqnnWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=keSrboDdnEDk+BOxBBWN9hfl5VamPSjisDY1VWOq4Ew=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rLFBx9bwaMvHmigA/CUibQ2CIvvBKKOHn3GWggWR2LB7qs1SSxFhZpKdSqjmOeAFeC8alyJ15zxWuiNsXUer1iBsrrHJuJvetpyD7Bjm+9eonhhaNeKTOaLd/nDn0YJykZ+u/PRCOIvh6lFSHbZOWW8mwr8ZoUVIWjFfVFMHJdY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SsV9sKsp; 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="SsV9sKsp" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8729FC4AF0E; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=keSrboDdnEDk+BOxBBWN9hfl5VamPSjisDY1VWOq4Ew=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=SsV9sKspSexexI2F7IzaVFT8w//xU7W4Mv40yapmj4TvLS6iwz1xktAqRlhinQmF8 Yr+CGSRkpzMqrGJwugTeiKCKvctiBPdGjsiFOp1a9opSjpbbh2qp8ERNUjpcNhzthK jrD7uxA2XDaCGcdZRoxQG90v36z1n3RuGsvgs63MybgxQ5Da44EwBvX9ixDBHjowTV rYO0yvI0WhBa7/GsDKB8FlyeuRAWfHi7IYlxJAPiCN4oAdRs3ql7h2s2dS35KHO8XL U3kw4rAxWW198KiPxkEBNOcHShJacSs5ZAEY0oz+tUgM1/rpdAPhCwCpkbZEmjXhEq VMj0OKE4Uhu4Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B0D7C3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:41 +0200 Subject: [PATCH 09/20] iio: accel: fxls8962af-core: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-9-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=913; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=4mWpFN+edUepEAApNSzBRyHgoD70Vxqq6Y9OZGqmjrU=; b=Q5tLlYPDxHAbfMtvcRj971Vl0lxoxT3px4ZQXt19F8RlGGCkWemotJzujrMz5YE5MM54lGnKB JgnHzH/TqZuBQ0hxTLS1Ohr7dDn4xnXlVSx928Bol5OMxW2lV0tR0Cf X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/fxls8962af-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 4fbc01bda62e4..7adb8937cb4b6 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -968,8 +968,7 @@ static int fxls8962af_fifo_flush(struct iio_dev *indio_dev) int j, bit; j = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], sizeof(data->scan.channels[0])); } From patchwork Tue Jul 2 16:02:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719971 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 B0E171BD01A; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=fz+9/GlGAgTyazPxRhGtWS+vwanb8br+E0b1t/fZ06Fl3KgnyKsjxzyKfmfvULEG2uufNCSw3h1UAiEkT66MpbdgZYp7IRyaG2DQ0vgk/1sqv8OLC+hNmHBm4jQ535b8BvjH6p6+YNSDsHBXQ3ySBvPomL5+YgJ4vR5m/7VjOlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=sC6ETYZGhKeNPuj0zZiWjODno6oDUaoxrOkaAN4705Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iMjXpV6tbaFj0cgqiUOgZKrtjs02afYLwdrsJcmMLqs2UIpGuD86d7TjyNmGHCEod6oD2sOouxs/VgGEkE+xLd7wAx5m2KOhSoNuXSAqSRNks+BVCwoSJbYTlQzrr/Gw0keEBdU3IWKiJxE7cNGJxmxHGZUWrTlOAFjkKsmwpf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dRqPCCHR; 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="dRqPCCHR" Received: by smtp.kernel.org (Postfix) with ESMTPS id 92100C4AF1B; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=sC6ETYZGhKeNPuj0zZiWjODno6oDUaoxrOkaAN4705Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dRqPCCHRXxodNkirSyOOro7wnrfW9Cd2oxcptRRDGYzWwHZrj/GxHKtC1QYotZ13x kfCP16V1+eTE2GgppDVcvy9l4uq4O1uqsrCit3R4okjYrXLjhdbGtwSnUZF7ceU+5E wKzw5dTF80AB5JNR1FC8cYcJqyT3kcMatIIhqsWedNyKtvUEq+kDvxBJLj4A+4C3SP TVK0DH80SsHh3CznrpbHDSBCs+CtOomIx/pgrZLHDWuTLGzb9XBbWWrYX8/DlDr1qb L/hQb49CUsyDX1OkheSkpTy9LCK0xD2t/MbPfnrnm09pPApC7XHaaAnbpcelFkauhN zOgsjgGJsHhcw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89E21C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:42 +0200 Subject: [PATCH 10/20] iio: accel: msa311: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-10-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936156; l=842; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=mlp145cykZFgcq0ksMJ0dMmg1Uqt+N31aaJsB4Dxu1A=; b=RKVvBr9oHa9ZYzfP7hszfF91tCbZHswMxdKBVlu19N9CRk3yM7Us+aLt5RvpjWY5oylhPI2U5 Q4H4Fy7vETTAd564DZvXYO/AfA1Si4c12ORmJ+On4w5TqjqX1htJQgN X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/msa311.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c index b8ddbfd98f112..8861010256f2e 100644 --- a/drivers/iio/accel/msa311.c +++ b/drivers/iio/accel/msa311.c @@ -900,8 +900,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p) mutex_lock(&msa311->lock); - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { chan = &msa311_channels[bit]; err = msa311_get_axis(msa311, chan, &axis); From patchwork Tue Jul 2 16:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719977 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 F10E81BD4E2; Tue, 2 Jul 2024 16:02:39 +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=1719936160; cv=none; b=FcduxiFUDts6ZjtIQMTq4SN/0MZhD4HwAiLDyQKOOUzj/0LkFaRpwoqjpyB8OqaIY5iRA89RmbL7qZQ9OCqOvq2M4A2a7jwcwnD7xnSC7gT+RM+nKnFv+YqZj9ft6oovi1s6Erd+y+l/khjYtUrLODt/B6KmL7Px1zpTryoax6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=uO8h95Raq2yO1cXDpXi+1Lxc+3OeSQ09Wa5SZdi33oY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D3Cs12eveeo2FJeUtHd9+refqkvHYvHsCVIrSyeZo2WeZ1iNg0BpabpxiPvETxwbwGHQgRhR6c6E5DmtMPbUy6OOtq+QL3nt64iLqYOw1LwbXzZB2Ug/yycT0HZRT/wEhvjDNmaDiQB5+3XEwc8L7iOzJmH1n+XePJX648cuT2s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FHzyyNCH; 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="FHzyyNCH" Received: by smtp.kernel.org (Postfix) with ESMTPS id A0B7EC4AF48; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=uO8h95Raq2yO1cXDpXi+1Lxc+3OeSQ09Wa5SZdi33oY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FHzyyNCHLBPRBrODchSbYz9J4OsDNnnhjiHTghKk5VyvmMTjJ5ywqMLa5g0uyCqrQ ipDEU9RkEXfKLqDBRD9jDCYKQVpAMHMUeF6vA2DbNpFtw14fH0V73NFh4F/0Db3Q7r xjamZAewyLP7mS1uqZKc1chUrblF+7Al941uB7Tnep5teG7zOc+V5u45Uk1wSsxrqw zaB0JRwTZwj6Ahlmj4Hxub3eAzCxKEXXPwudOPJ86PpoJnb/bT2GhmVQADpWsK28TN YbLMY2D3uNoYWHLJB9+629xNRMZaSM8HHV/eVJEKSHlci/e6AD2xjRLv5C+KjAnoPt V2T3nf2RsmpIw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99228C3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:43 +0200 Subject: [PATCH 11/20] iio: accel: sca3300: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-11-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=930; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=NiKRjo63/+CijDcg34TeX86O2hQZxnlYkTzG1tnolLM=; b=jPnvlGu2A4lqfgW/FRAGVpZf3vAhpuc2SU3/FBNHyOU5fX8sYsPlhAeFv8kmHbE6KA5zkQ2+E mO5j0bhHf2OBadPDqmAb8uiWfq07u9LfBK0TjgkXcnZpPv23KfZLwka X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/sca3300.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c index 306482b70fad..fca77d660625 100644 --- a/drivers/iio/accel/sca3300.c +++ b/drivers/iio/accel/sca3300.c @@ -494,8 +494,7 @@ static irqreturn_t sca3300_trigger_handler(int irq, void *p) int bit, ret, val, i = 0; s16 *channels = (s16 *)data->buffer; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = sca3300_read_reg(data, indio_dev->channels[bit].address, &val); if (ret) { dev_err_ratelimited(&data->spi->dev, From patchwork Tue Jul 2 16:02:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719974 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 CDDB81BD02F; Tue, 2 Jul 2024 16:02:39 +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=1719936159; cv=none; b=dOIyO6bIEmjmWPsLP2YhvBczaf01KASINmrCf2YF6ONdsWBH1EoRsp8iSrfID1JAYZStFvXt8uqtRR09ZI9nE82zoZ//xe/RShdBLq/IsoT32wLTsJMDQ/gDz9Vek0IlUu6VCgDmthGIgwSzmbHSzlh4cyY9kQJwi5VeMoinAZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936159; c=relaxed/simple; bh=nfHKW/AF9PYmMiW+5wqrALl73lz8upCgwUkKe9Zapb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DyclwgXPCc1JEGZBveHC/O2eUiu/61qiTzaqg8V1lJ8SPikY3cbGf6hVoRbwPkN+fXCor2wN/SQqU0rTw6j5R0UMnZVDRXp22eWRoAIijwwF8IjdSJFAqA0MFt+R853awY6481x97F5eWiqW8+JraQZ+17g0pTWLbLKdpzclEro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G0o+Ko7s; 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="G0o+Ko7s" Received: by smtp.kernel.org (Postfix) with ESMTPS id B15FAC4AF49; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=nfHKW/AF9PYmMiW+5wqrALl73lz8upCgwUkKe9Zapb4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=G0o+Ko7sCr/Bm31UASvWzzwCMb6bUFhhwsXt7sRKF9fryxK4hziSjxJIjkxXX8qEE xuqd0E0ifjZheGTea4byqsLfOgZ2+3AUDXvSBvMLSbbqN6J087iHjRCoaN4ES0c0st 07WPwg7FiMV8aeiDqSPIAS8GKGRU7PXsOyuvWIREH/f4hiPgO2nWB1utwGUM+msCiM nmxsRUDvPW0iZM3ltJNxIxFp1SS6PUiuYb2UVFy4GDNLrW7Vq6jNTyvG305tLesL4m /h7ZEOfAsmMGRbdR5+FgyFcG9q3+T2rGAQi0egim/i6PRyZgCeemVHkkjRgj4Vw8GN nIQWTQZHDY3KQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6AF8C3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:44 +0200 Subject: [PATCH 12/20] iio: accel: stk8312: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-12-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=860; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=sKvcghE5ThQXXY6IqazRh2jRyFRk4Gvhw2Dt6y9Vhp8=; b=kt0rMyqWMfymAI/q/Z0mnVnvXvK3GnHs++rHvCcBHM46WfZB++w555wevU7tgbbCqcgTdmB6j DpFqKVZfwP0AkzerK5hCIynsQ4wo/L0jH99Mjn/zsRlGOE0exxAh4Ko X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/stk8312.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index b3534d5751b95..abead190254b5 100644 --- a/drivers/iio/accel/stk8312.c +++ b/drivers/iio/accel/stk8312.c @@ -448,8 +448,7 @@ static irqreturn_t stk8312_trigger_handler(int irq, void *p) goto err; } } else { - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = stk8312_read_accel(data, bit); if (ret < 0) { mutex_unlock(&data->lock); From patchwork Tue Jul 2 16:02:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719975 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 D79791BD035; Tue, 2 Jul 2024 16:02:39 +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=1719936160; cv=none; b=E9SK7HBaoU71ngX9SY30yTYMdcVS83QmM30D7a+kHCRlPl7Ivn6iJclx4DA+4qht/tZRGqhH/ue66z/8GwKhoF6ivutSHKplt6DNB2sdPWj/poIXZ7OPO1C6HiHF6kVjfSWp0vgrtNqAvGB5/fONn64Y9+/mfmAzcUXoWpWTei0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=rd4bK4dYxKBbRt1v/HZMzCwZJy2bdmq2nBBb4Aozq18=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sxiBlwPqotZJ5A939f5sQeM0wLodYn0tsgC59cWhtV3n+Erg7npHrVhB7dx7Xe+NKAMN9CxM1P9WA1ggQWF1ID/VNDFMjS/ffLaxt3om4c1D4hGTqrYJUzq79xA7GOjhhgqbzq0GhNcBOSFEATlwpm+O2i/W2Za1y4CmsL78aZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ijd0h4VG; 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="ijd0h4VG" Received: by smtp.kernel.org (Postfix) with ESMTPS id BB7F6C4AF52; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=rd4bK4dYxKBbRt1v/HZMzCwZJy2bdmq2nBBb4Aozq18=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ijd0h4VGLKb6DgMe5DsdLxpkH3LbYrWs2NMHmaMDaNc6tVzkfMo9kUEP2wJrGsGc0 Od7mnwaGsqanwApfirV7x/qjlneE7P8aP8x1Fm9ophsegSrP7eYvJeoEmLudFDhu46 5R38H33cLnWvK208CK2BHc4GkhONUHJX4aQbCMLiLThgjBSM5TJYJre3tyY7jsOzgo S1obIwoNgFve0lCmS687q8eUNCie0rtx1xkEJJyRc+1vkcSDb6gnoJQItwX3u3YQ/A EnGb3s543oao/IsJDJYO5n3x1OEVycMYz6kD3CqdQtazs+Ngbr9+BihmUOH1XShqe4 vbc3YABjmuVpg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4516C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:45 +0200 Subject: [PATCH 13/20] iio: accel: stk8ba50: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-13-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=866; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=TFHhQ83QqdJS9zWdzKNj08+dSBp1rdr6hB/g9TIyego=; b=vHiGPKXd69rf0HoQ0INFT45P7M/hmXLo0wVQ4CVhuTDIKz0/OPtTpUelGoQ5YexRkZHIpbO2c 3ZzhIyVx1UQBU3qUZQf0pojqjpQ5CeCmKRq2Aah3AUVM5WwC0Yayj7w X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/accel/stk8ba50.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c index 6d3c7f444d21d..a32a77324e92d 100644 --- a/drivers/iio/accel/stk8ba50.c +++ b/drivers/iio/accel/stk8ba50.c @@ -330,8 +330,7 @@ static irqreturn_t stk8ba50_trigger_handler(int irq, void *p) goto err; } } else { - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = stk8ba50_read_accel(data, stk8ba50_channel_table[bit]); if (ret < 0) From patchwork Tue Jul 2 16:02:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719976 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 E727C1BD03C; Tue, 2 Jul 2024 16:02:39 +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=1719936160; cv=none; b=miyyGxrzIpAnCVkntP/M87ccY+wKPCQt1Wj/mehq97Mc3fUVs+0jQVTcRLrpbB0yx4MCyd/jUVnIbkEWAaPNiY5hu7Y2ryMcVEAp/uyEF0PHOu0QNwQudV+SmuoRm1OtmVyVxNTAAd0Kccf2qhpqAaiJUfTqwBwyvDxe8J1aqNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=5Sqf3gwvJub0vRMW4cTH/hkIJm7o6yILPfaLsjTjjWM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CqX8p2PbQpFO54LzraGcBULJ8y/VencUCUoFFn94aIv8SoVLFSpOpjgUTfpNWN+p6LkOrgRnCxkoGa/cfoZ4w8zbIKEvmb6o1lVp5zsale1wts0tJJ8mNrXlZOoYzrrXswxS9tEE6DusbnkzdjOwgCVtuYKVacGaCcgXdfpLQzM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KhUiOTLU; 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="KhUiOTLU" Received: by smtp.kernel.org (Postfix) with ESMTPS id CAB6AC4AF55; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=5Sqf3gwvJub0vRMW4cTH/hkIJm7o6yILPfaLsjTjjWM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KhUiOTLUnQZcDD+FUIM+JKIGCq2LQ0g8oiC9q5+/cC0EkFoms0MuznBS9mF6wqt/R e+mvXEpIbxbJuGGAVReEOu/RsIeICHwUIc2BDL0lXUCnzlc+aWLU2kX/29bncr2yhl 2dxvT3WaqIUui4R1TpecknVqAmY96yNph3mgTJRDlFO5YUwwq4RNMV1mmYGCFUsLPA K7t00u6NyC1jrZYo25s3qRAILBXX9TnIlfr4jUdBkoqBfT7beVrNZslbO5FelwDSfr cJntrdS+jRxYmTzroiBP7Yi1n7NHcopX/5csagDuBVbdeUamEBY30308/iwgcmaDgE qvtWahIGo+oLA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF609C3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:46 +0200 Subject: [PATCH 14/20] iio: adc: ad7266: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-14-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=824; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=+iJJW6/7I7TrYM1u+38IFCTTovEcPX4B9OrELlHsb2g=; b=7l7oJaQgLVUbsFsJZpuh/oP4+s8aNKMFAN7qbsnmyXqXb2eNN2i7UbGgtUnd4IeCXab9ouPGq SZ74x2ZsSvYCRuuQk6YpSeKtcNQz81jnLAy4vhEy2qwwXAOue7kJG3/ X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/adc/ad7266.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 874d2dc34f928..accb78d4c3086 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -123,7 +123,8 @@ static int ad7266_update_scan_mode(struct iio_dev *indio_dev, const unsigned long *scan_mask) { struct ad7266_state *st = iio_priv(indio_dev); - unsigned int nr = find_first_bit(scan_mask, indio_dev->masklength); + unsigned int nr = find_first_bit(scan_mask, + iio_get_masklength(indio_dev)); ad7266_select_input(st, nr); From patchwork Tue Jul 2 16:02:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719978 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 016D61BD4E5; Tue, 2 Jul 2024 16:02:39 +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=1719936160; cv=none; b=jXWUQ8byFEyKHPJhRKK9NTaS4Gb7au+csgtVPC825r7jZDd5NFQ3/y0n8hB/TnOvsEO+PGW1BkeHdMkQc6xxYz27fzc+Mny2WHxyoRMItBef3C5IEYM3eLUBZGnJ3w1rr6HOmACMQ/C01ytRoEznab8nTZN71QTNiC3IwpzTolE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=71yuAUOKQP1vw736p1/RjH6fm1/8Q3DuQ5CHUBxzKZM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JPO5eJZ7+cavzpPm7HMqA+K82VkT1tExniMFsHvfmSIIhG0w2XAt8SaOJrslWfuRkEqrj6OyBdkcFmvRmZdFQnEPe75YHdM4GJ37sRfxw8DuWEcoXVPCeijKFDGkjKC2mHE1Z2sgjj4BwPOw86foqeVFIVDvb/AfgO3rGwj3L9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uW8b/Ltn; 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="uW8b/Ltn" Received: by smtp.kernel.org (Postfix) with ESMTPS id D9145C4AF12; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=71yuAUOKQP1vw736p1/RjH6fm1/8Q3DuQ5CHUBxzKZM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uW8b/Ltn68boEo6cbtU/0evdtMrP+Lfhbqn1Jn7SXi6rhL9ls7GcKgvHvw3QvFYNE jG3j6iBRiB6ZXav9XPw60Bn97M2BHD5XpHRssmwy/Afx+Gg2NIAFa5Xw6wENcvA6SV COCXWYKNPzCwRPSrcB5EMOVyG20pie+Fi85m0lm4ChyXZ168NYWhXAsKP9b4AtvYOE y81jaxNCJpikWR9ZDgFkSpdfVJsd2PzCor8JVFp7orHvjzsTH+pTHg75BwlLMc2uVJ Bx0rDhVf/2RvBu6b5q2BywM7JpwabuCC1NXcx662sg7V33t36/+z5rQdPxWZ8GPHMZ FvYmMJXLr813w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDECBC3064D; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:47 +0200 Subject: [PATCH 15/20] iio: adc: ad7298: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-15-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=801; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ZK5+aMXYaMNYV9d90opMtFfRkoEJrZPm17fO7HBXKCg=; b=bBdOYmZMjoXy8dHw5U5DCzkC1MW642k0qxtGkPbdxSpudzdrcC1SyHkq1BXJDjzSOQsc2EYqH PKMs/R0+RzqB2zgmUTR43u8A7wBZFCtENhKKATYeu6u68vHJTWB0Imh X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/adc/ad7298.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index c0430f71f592..0128436367db 100644 --- a/drivers/iio/adc/ad7298.c +++ b/drivers/iio/adc/ad7298.c @@ -109,7 +109,8 @@ static int ad7298_update_scan_mode(struct iio_dev *indio_dev, int scan_count; /* Now compute overall size */ - scan_count = bitmap_weight(active_scan_mask, indio_dev->masklength); + scan_count = bitmap_weight(active_scan_mask, + iio_get_masklength(indio_dev)); command = AD7298_WRITE | st->ext_ref; From patchwork Tue Jul 2 16:02:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719979 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 1364C1BD4F1; Tue, 2 Jul 2024 16:02:40 +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=1719936160; cv=none; b=PXk8J8FpWbpbQBMWeUsRinVxWt0HA+NgB09jkPDJ4jpyqvo0yeLwz6QsTxWXegG+JKEZUWiUnapL9YE/zcIoGTsRsT5vzQ0Kr8e8uqQ1m3qmRUb4LOYLcLqd9gyqTLsM84kmaLwQXDR670Ttc8aqA11PmRs/MkWDLZ1OQONn4Dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=3C7xNuV7g+Pf5OBq4kNLo3mjBqcMTFSkkJEkXizSXuE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EwkziBor2x7Mti15foDAKFfBZwdivnC6S36e/CqmSzEnqEtpS3SJPCaIALeYIbAdomN4XY5PvcyjVaKpg0mJaffrkjyoDzIbVFs0m6it8XPccNbXuYioJeVZ9Rv3y84KbOTgBFu1VXoDJL0u4JJ4NZCqL5PLFdgWngV8RMzd5aw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S4NyZUi3; 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="S4NyZUi3" Received: by smtp.kernel.org (Postfix) with ESMTPS id ECB95C4AF61; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=3C7xNuV7g+Pf5OBq4kNLo3mjBqcMTFSkkJEkXizSXuE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=S4NyZUi3OIU2n/fcHqJiRu1Fy24oXFT9thNvHhOEPPmrLhfLdMTzrflFTI/9z0UPa RMmr5dgV3EzQ6tOZJoPPA9ult14syGC9hwatSRtyXMeKkvDQANnM1ucYTcG6HF5NSW E/0pGhL7Gqcg90n5KCwOe8iWF0UR7qesfJ3zWKvzRVMdAPcy1UgQph5wH8cbAMaDx6 rvKn0/rF7ry7RAZnROpoJRfqBOCHzlOgKv2OBP20v/2VxeQTucT7aXFxTXBF33Lt2E 1/rgVdaid03gB7Fuz8+zliY8ttw90tCe9I5Ft3HZqevPAoi5aupz7xKOAbfx12QGjP /Es8YFDMUDH/g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE707C30658; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:48 +0200 Subject: [PATCH 16/20] iio: adc: ad799x: make use of iio_get_masklength() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-16-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=791; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=wWndx9yRTDx49TztOjVCAJ5yEItwvGvV8lgnhI1efkk=; b=h45vVL4Ul2B1DhYLqcsnz1Wp/Q8mkB+/gpyHYoVmBZuWoZ1M6bMprsUorUO2yz6D8zWbYsDBz eOPXJHEaY5nDuJuHTISepLyyHz0WZG4h2xB9hbMrT1qh+vX3r4jOBxg X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/adc/ad799x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index 0f0dcd9ca6b60..0f107e3fc2c85 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c @@ -237,7 +237,8 @@ static int ad799x_update_scan_mode(struct iio_dev *indio_dev, if (!st->rx_buf) return -ENOMEM; - st->transfer_size = bitmap_weight(scan_mask, indio_dev->masklength) * 2; + st->transfer_size = bitmap_weight(scan_mask, + iio_get_masklength(indio_dev)) * 2; switch (st->id) { case ad7992: From patchwork Tue Jul 2 16:02:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719980 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 2CA571BD501; Tue, 2 Jul 2024 16:02:40 +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=1719936160; cv=none; b=FsOSSE0eaQpcZJzGGS0N2OB1CnZ4qhPzeWBnkQT6YdfKanHDuRhs7dJbYxX0BPPW6Kbt/wDahSTlrkIkW2ODx3/q7jthJDFNtT2LCUpN/kc1XYYIB+nZbN7HJFd50a4ZXNbqafWCKWVe9MjOyqPBgFPw23VnKyuy55cEqujqAp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=fE3JhjjT2bztKbT9EOlEvE1SsTlV+JMoyOGt+QtwuZs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UjIOWTU5YAeCVniPotFab0OFMDoo9sA/dNTr0028KYt2/xRhTj/+6yUZnNZp3uQlT2W2II9Gu+XMtWYSw0Zo0mnRIajcUx+zy9cilk2mRGdHGUxdNWxNrb6DXXUZvAKq5V5/DqjcTIQYjaUYTV78EoC9tn7X9dYRX9th8dxj9vo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eGYWFwgq; 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="eGYWFwgq" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0EE9DC4AF68; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=fE3JhjjT2bztKbT9EOlEvE1SsTlV+JMoyOGt+QtwuZs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eGYWFwgqqvXg9Bzn41VrH2vawvuQXqsjfcV35VVcEis7XSUtBig618DLuReJejf2G FokgPm69EGEzxUMXruS9khYGzECvWrnul+bogqojcTm4KT7QHQzpuNrZrEnk420Iol 6+1+I8k1GXoyrQAVbOBp8Z59gnYcXBrYaPyDuGYd+6552criqW7CyaMVKKdB6gtyln ZZ1Vn+yU1VmAziug1gH0eguUPtGUm7RM1Or06RlMrjB2m1vTFStMQ+swTNXxLzLvNS Xljzl0UKoZuGh/f3+9XRQkRoHXDzA1qYLp7QRFnvBefCe4SG88v+f0UhHEf7CeW74s 2JvBpPg5jNsZQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02B68C3065C; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:49 +0200 Subject: [PATCH 17/20] iio: adc: ad_sigma_delta: use new '.masklength' accessors Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-17-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=1684; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=GoBEg3yNYVlK4uhicWAng1ZNnwcbQvwHl3xbhcuNjPI=; b=wH7sHfvZ2g43QU6gZdGIAYHosI3ta6a2Y2rX0bDLPTTZP8YUKYKEsPAHOiPLFkpEy6X8JewNQ inqywiBMXhEAwR5cClPLYIWa1ixv/6XnrnAEBltg4drZ+C/pVbkHVmn X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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 Reviewed-by: Alexandru Ardelean --- drivers/iio/adc/ad_sigma_delta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index a2b87f6b7a07..62653d7fe39b 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -350,7 +350,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) if (sigma_delta->num_slots == 1) { channel = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); ret = ad_sigma_delta_set_channel(sigma_delta, indio_dev->channels[channel].address); if (ret) @@ -363,7 +363,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) * implementation is mandatory. */ slot = 0; - for_each_set_bit(i, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { sigma_delta->slots[slot] = indio_dev->channels[i].address; slot++; } @@ -525,7 +525,7 @@ static bool ad_sd_validate_scan_mask(struct iio_dev *indio_dev, const unsigned l { struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); - return bitmap_weight(mask, indio_dev->masklength) <= sigma_delta->num_slots; + return bitmap_weight(mask, iio_get_masklength(indio_dev)) <= sigma_delta->num_slots; } static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = { From patchwork Tue Jul 2 16:02:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719981 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 4CBAE1BD50E; Tue, 2 Jul 2024 16:02:40 +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=1719936160; cv=none; b=Jok0T2haLu1lUVt1+Cl/NVbeeeHpKvKCXOqcHcMuM7ifpKUJTqUQi1kHeYAi//pMC7zlCL7CQwTC/0nCz5quXO5hyqfWlYwKgCpGABMOoxTsP7FrAJ9eDWm6fjm8eZgJaDnBngo1gJpND/uujCaGUDZdTXolFUQu19dAOKkk6n0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=yOWVypS4kSOx1G29xEk/xKSpqDyhIwoOhx6i3r0Qfts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mo00DWjhlGGSvxzZBvscqYI73zo+rpBfMO2wmmxX+Y3spSvGgQx6807QCbHDFgIm3gZ/JBbmOKO++VGkK/LfAofjQMB7HFsZpoR/G0OqxU3EYDENXmBB56iqnRJgidpDrmxSurvrSd4YMTGO1dlDtc9XOIFroVAArBh1D+hVfFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kwn1cs4o; 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="kwn1cs4o" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2387EC116B1; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=yOWVypS4kSOx1G29xEk/xKSpqDyhIwoOhx6i3r0Qfts=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=kwn1cs4okhnkZgPsHVSAptADCRALmck4WOXA+YKCvDogxZof0aUFRcfTEmRCWmRxc O88Fh0ZrsndbCsax/QVZkZCIEWCAp8x2T05jujRk1NePQ7m54je4OQlbyYDvWD+HRK AhyLxgBD+lGr/sy6GupLSvtHU+T3ezd3l8Cg3SF2aVLtAVqsu+pOFd3hNFV2ff9Yfq aN/sbA4AWr7aSMp8HdNf7Fh1SVeybPR1eyIFkXM4kHhDjTGSoLVC227Pnt58VZyix0 xRFPwGuPHXGLOE7uEoQoOkCSdEbXcnGiW5qF/LkbQcW3jtqhcRECmohNDIhy3tqbjT p35gUew3vajUA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1964FC30658; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:50 +0200 Subject: [PATCH 18/20] iio: adc: at91_adc: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-18-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=908; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=W/t1QLnOMBghJ3cBP0Sz8vy2Yubdg+XmvmGHI/DD3L0=; b=UgykRrQ4gxnOiL92MVtaXiv5JRu0qLvRXJ3en/zfBLdcF1+6f4aouctfdqT139Xlq0n1yySoq /o3KRpCxAeyDCNviZtJkLh3MEekKinZgzRRLzBwuc1kxonACiBumgdF X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/adc/at91_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index eb501e3c86a5..af4b0224076f 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -268,9 +268,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p) struct iio_chan_spec const *chan; int i, j = 0; - for (i = 0; i < idev->masklength; i++) { - if (!test_bit(i, idev->active_scan_mask)) - continue; + iio_for_each_active_channel(idev, i) { chan = idev->channels + i; st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel)); j++; From patchwork Tue Jul 2 16:02:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719982 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 5657F1BD511; Tue, 2 Jul 2024 16:02:40 +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=1719936160; cv=none; b=KuPqv4flwaolTEp3FeG52V9dIUbZB/7CO0KFhu1ZbUMjJqYFr8pdWDTAf4O792Wwyf8l/2F7rbtHfnKLgKm1kOx3fHKwBZgN8M3M4pM5rYPnuXH4ahECqVlcnJC7JgqE3UUKY01aOxpFxmj/fB/o7e3AjaR4StyFksGCFSl9wIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=mpdIPf2JJyuaQzZPivxG0g8giXcm2FQ29mHR6NwT0Pw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NiUHkRYDXGjFnUdpvPgqV+YMpDAdkgLD7reA8L/msJQP/YyM4fWU56ahCDJxRlKLSPoA9e+7kQJQg1882QyvAkboaSIYsqL86B4BnS0yUfATxS7uir4XidyqknPLE4ZrJ3k8zEhz8LunXDy9m08PyuyCHjhEkczR2Xny4t/vhwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EpZRbxI0; 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="EpZRbxI0" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3685EC4AF13; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=mpdIPf2JJyuaQzZPivxG0g8giXcm2FQ29mHR6NwT0Pw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=EpZRbxI0GenslmjeOX8hSVnqDQS+RiaydEx3/92bIxJncMdwv9pPlh2zHzPoyjc+O u3w6m8Pjw1VyHHk7jZmUFeSx/MJ1iDLGRUF8OnsuzcKY0QPQku1Qj+rKlFvBfaU6l+ dvawAhYyzONpHDnY2jkfp9fN7pSA8KxsmKT/4PGyc2b9ZdNGGAczjRpM8GtNYUYlSR VWtX3Cghj9stii2XErXQBG9czeuazUj7sxqIC7PoG3SbACO3npOqGYJdkN/NHaOD5z 4Vsiv6buPwBEtO46wQZJVhUyaLFS1i9EN7k2jHidPlYwlnQftpdjbxgkQ+sUCp9bmr awc9Gt6lmHiAw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E58CC3065C; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:51 +0200 Subject: [PATCH 19/20] iio: imu: adis16475: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-19-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=891; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=R0wwlEsuLBVxnsU+A/xQqthiBloXGcKrV9R2Xe/WNOk=; b=ig8hNaFeuY+6AqHCCCLWYv++S5uIRb3T50cfV7rToGdVwa4/sz19fb3vXj3FPvwcRRv4fEkYs ipUbY1hCjTzBb5+pF1iDYBRZBlX4YQe8ZMXCQhzqRwIWF+ie83Ry+8w X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/imu/adis16475.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index cf73c6f46c79d..1cc2a66a78ff3 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1608,8 +1608,7 @@ static int adis16475_push_single_sample(struct iio_poll_func *pf) return -EINVAL; } - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { /* * When burst mode is used, system flags is the first data * channel in the sequence, but the scan index is 7. From patchwork Tue Jul 2 16:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13719983 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 7F9651BD51A; Tue, 2 Jul 2024 16:02:40 +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=1719936160; cv=none; b=KEre18zrySd6SsnUnTVFC57l/EE+C54gpUojJiQxFUM5VW8ZgjfzSjC2zZAMvumSsIMsZ2ED0+oUJEw2Dr89niPIfu8mjxTGCg5gaAosqhQGUudZmU0Cj++hTW+usspxqsRRIVaUCRXm0XArvkhYLaCE9uAeLpPHMEaEFJuLJl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=66crgnursJi2B2eq0VvNe1euuje5cNpdlKdf9yiBQ5Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tUNhn75uANEsFQ6zFBqpsOdN7ylS5E9RELQs/yt3C9m5CBSB/SOuTjYtSWRMEzjKs2OAWyqW++PFBGWh+HRCokfdKtMe6XNq5hL9SwVQS2+iSI8TmlhtbEVE4YJpyisVbjkeCVt2h51SAH+E2zD9Czd+s3qDKTSiW9rOGt9afW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uX4ybv3a; 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="uX4ybv3a" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4797DC4AF17; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936160; bh=66crgnursJi2B2eq0VvNe1euuje5cNpdlKdf9yiBQ5Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uX4ybv3a6Z3mfPKeNbWh4RfSjDaMSWtQTyu6nIqPkcR0t8MvIzAuA68/7BFq4G9jO 0PnFuq0vn2f9lwqCmRg5/IDIzw04V62frhAkVbx7HjomWq6ZJ7aqXHyYZO/Hray97v s7ZvaZvm0OQCAOSzFT0BejepkFxud9G79EUbFv7FHwxqplSyj+PWqGJBBVzLSyCz8I dgBxEH8xUZbKaQlAkaQk34EzGwD3mcYDbGizZYOVP5QoEIsIiGXa3Zsbv2TOhwAsUF OyEQ6+SFzxJhg1Qv+JeB2VR1KF0yazmhRG8at74lm4rKYM0kk4B8ge/kRt43B5IY2M 13yV3pq/zovYg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D814C30658; Tue, 2 Jul 2024 16:02:40 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:52 +0200 Subject: [PATCH 20/20] iio: imu: adis16480: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-20-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=884; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=9JQj/jSVCDw6YceIOCpJXsyqqh4Yh0od5ovTl7zFZaw=; b=WbKDEozkTJlTjNGGrlbP8WBXQHbJ9MxM+I/TdvuUkOeC2Du4VJFmRNR/8xcAc92ZixIlu+VhD X8ML6nmxoN0BUGffY3qH5gMINA/SRS1OC/SWA7+oK2DFped747Yb4fc X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa 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: Alexandru Ardelean --- drivers/iio/imu/adis16480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index 56ca5a09fbbfc..2f08268bd724a 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1410,7 +1410,7 @@ static irqreturn_t adis16480_trigger_handler(int irq, void *p) goto irq_done; } - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { /* * When burst mode is used, temperature is the first data * channel in the sequence, but the temperature scan index