From patchwork Thu Jul 18 13:37: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: 13736538 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 96ED713B290 for ; Thu, 18 Jul 2024 13:38:25 +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=1721309905; cv=none; b=BgezxObDXhwZEXEWQZFiSnUszRczM/P+J5mVK+nzf9BPhtvz0QHLyirDtiiG21x9zxTpeoEapl8LdPVxmxhloNziELWApLd//eb3740Or/zttUDb/P625cpzD6WOEJmd+STC10+u/c4GcCaAbBSFmt+UbAePtB2WKNgngiqdAQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309905; c=relaxed/simple; bh=ocJEoe2Cw41p1BgnfVkxu1byJIGdYc9nRbLJ2i6t4ws=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rcXCn74Z2T5waTX3fUgJtZ/KtnZ1m0mXqbpbf459RORQuUcxpqiUNmKvcwtpPZBk2J/oocB3aLnXIld4F5kLtS23187TGNCTluNe/NgUgTMvRNbytz2DfXXFdMkG2A7KHa4qCX0LWgO906N5ArkwCWR5WJT7SLAR2RikLpd6chY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NzVAqvRV; 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="NzVAqvRV" Received: by smtp.kernel.org (Postfix) with ESMTPS id 47E2BC116B1; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=ocJEoe2Cw41p1BgnfVkxu1byJIGdYc9nRbLJ2i6t4ws=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NzVAqvRVKobhzqHIGVSViQqe5vsEytHD2yT6lSkNz8rtZtLWBufIfZvnKPhrkpXlO 0JD31ryTPM0lRm78rj9qdzUN5xkqe+BESCE3HBteL1wglD//wBwBIX83NroB7+vyFI j6qUySnA0DEK2tdVcpNa8fH0wXjpBkdUP6D5JgGW29Pmpakqu3/ZkyG4GL3/2m+leV udigkzd1960cw5p5yCGGNlcCwHHYf0XpnsvT9WqJw+unCSBFQQGSWZoP/tIt0yL718 h7o2RMMtXMc3SZGwf6ToZA/hitXAkblsdbFCnKJllKlrOuCjtFDgaNb2T+Hjy8eRj7 mrWxNg+F5yJmQ== 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 34609C3DA6A; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:47 +0200 Subject: [PATCH 01/22] iio: adc: cc10001_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: <20240718-dev-iio-masklength-private2-v1-1-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=890; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=7KQilIgM9x/pjjV8IpQ1xKu+V2/UHH1gFTIwZPtjpgg=; b=fRsRXoEKF4YGid901q5e9xKkLzGZU67xeNH6uMS37BmezS6j0kxav4HD3+uCyY+mcWK8sNBm7 rfEyY1iu9/PAdUVvUm+mus23ZkZs+gzMkemRa3Fk8xcUW8uNgmwBxoC X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/adc/cc10001_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/cc10001_adc.c b/drivers/iio/adc/cc10001_adc.c index a432342348abe..2c51b90b71018 100644 --- a/drivers/iio/adc/cc10001_adc.c +++ b/drivers/iio/adc/cc10001_adc.c @@ -157,9 +157,7 @@ static irqreturn_t cc10001_adc_trigger_h(int irq, void *p) i = 0; sample_invalid = false; - for_each_set_bit(scan_idx, indio_dev->active_scan_mask, - indio_dev->masklength) { - + iio_for_each_active_channel(indio_dev, scan_idx) { channel = indio_dev->channels[scan_idx].channel; cc10001_adc_start(adc_dev, channel); From patchwork Thu Jul 18 13:37: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: 13736540 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 A76F113D2A9 for ; Thu, 18 Jul 2024 13:38:25 +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=1721309905; cv=none; b=mmZ3p8rGmmaZ1KhqVIvs+SHoN9yPjWuh+grOhGgX45G89qzkmYZ6F7+zGd3LAD8D+Jp9tgCZbIp8GMrwu7poIiKPRqAFd6Jn6mDb2zmvIY404ozbhk+8uLuoSuguTBYWrDFSpQ5fFKWMZMSP+Z69Rfu9RlPVp5LqWbL2mR5JP3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309905; c=relaxed/simple; bh=5kYGH32Wpz/uNIl14Tu1KKxGLY+TV7PQmg1MnU82w+k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XUD19i3xY8nPTZ4r1VQSOx8Sg3CwwOpmD1Wh3JhnD7EzheVUGcc2ZlOK32OcYqdn+mFG4rmNFOb9f3V75W7gUfxKbF/G9fHTMChaz10DqJveMgfmT9gsb7znmU3NK+pBuRy9gUdAfI6LkaGwKQZsIXOXE3crHPF1WMcXfe53C8k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IWnNJkV6; 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="IWnNJkV6" Received: by smtp.kernel.org (Postfix) with ESMTPS id 57539C4AF0E; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=5kYGH32Wpz/uNIl14Tu1KKxGLY+TV7PQmg1MnU82w+k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=IWnNJkV6jgW5kfHBb/zfXyBpcR88TDi67fbClQFA9rDZna0KJxzbGy3mUjJpUXh88 he2jvTuIB5lfoRE7qo5Zaa4lm+V5a56hzBd8ETR4CwpBJ4RSLK8+e7Q5QJlQeBA/3Q J96dBBW/cHXV4keFMwxk43oyYclUDij7YrbhWmcK+e5daJbQt+zbQA0lYArOxlFJk1 deS9bHj7R1qVAy9MEunEf+fBbWjdM+MlLOKH/9duFKLsAjFNd8o4xrsVsOaqyN+EME cGcnZ7Iic/nEPT1oeY93w212n2dxVntKdXsBdf+Tq1B8hjoBT1rsr2lgOJxbIuui2C 1cuZlcQi/GXFA== 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 44D07C3DA6F; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:48 +0200 Subject: [PATCH 02/22] iio: adc: dln2-adc: 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: <20240718-dev-iio-masklength-private2-v1-2-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=1702; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=SVzVUJhUJEG0BkoeN3CF9y2OFfW7PnyRhClF65Q6WLY=; b=ZBWG1YfMAwcurvzBRn9mCDkOUHRVFtnp29Wq3GrNTMZpjHgzT1+Pq/XL4Q9LpOogmNRV8K5Np pVnbhPOzkJoA70sar1d44x+XLZD55Eipc2NeXWJ20r9v0YzIK9nB4XA X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Make use of iio_get_masklength) and iio_for_each_active_channel() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/adc/dln2-adc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c index 06cfbbabaf8dc..de7252a10047d 100644 --- a/drivers/iio/adc/dln2-adc.c +++ b/drivers/iio/adc/dln2-adc.c @@ -108,7 +108,7 @@ static void dln2_adc_update_demux(struct dln2_adc *dln2) dln2->demux_count = 0; /* Optimize all 8-channels case */ - if (indio_dev->masklength && + if (iio_get_masklength(indio_dev) && (*indio_dev->active_scan_mask & 0xff) == 0xff) { dln2_adc_add_demux(dln2, 0, 0, 16); dln2->ts_pad_offset = 0; @@ -117,9 +117,7 @@ static void dln2_adc_update_demux(struct dln2_adc *dln2) } /* Build demux table from fixed 8-channels to active_scan_mask */ - for_each_set_bit(out_ind, - indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, out_ind) { /* Handle timestamp separately */ if (out_ind == DLN2_ADC_MAX_CHANNELS) break; @@ -541,7 +539,7 @@ static int dln2_adc_triggered_buffer_postenable(struct iio_dev *indio_dev) /* Assign trigger channel based on first enabled channel */ trigger_chan = find_first_bit(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); if (trigger_chan < DLN2_ADC_MAX_CHANNELS) { dln2->trigger_chan = trigger_chan; ret = dln2_adc_set_chan_period(dln2, dln2->trigger_chan, From patchwork Thu Jul 18 13:37: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: 13736541 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 A774E13D52E for ; Thu, 18 Jul 2024 13:38:25 +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=1721309905; cv=none; b=emCZbgdpmEo0pJGHl/dF6pivH5cQcoTl1mxTalpc9m4dR2kC5zDoYofKugPNust5QWNzrtU+v3WJ5o29rYSBgZ/pSGdD5CycfO0THB11EHdod3cuZ6IHpDWFG4XdE9B5WSOSJBLZJ2TpTuJac8ReMs7GUfT7v7C14IhLJSWrdcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309905; c=relaxed/simple; bh=Ch3X2bqvmnrCEzV5plOeGqQb8KDZBliDSV1fsN/WO5s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uofdkrzp7+2mVTrSwrsUe59i5MPrx8jnVJzIdNa7yP2xYVZySXd/vmspJHNoeU7ivPVG6RADJLSLOGspuoijCD2Y1OLPqhn/0jiPk1dhgpuBGSBUY7Ms50dl2fyhV0Ulp2l0gqtUdz6waDMJ5r8rCWP/nYn7C5G9rnbV2845iUk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kvV5jRsV; 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="kvV5jRsV" Received: by smtp.kernel.org (Postfix) with ESMTPS id 61981C4AF10; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=Ch3X2bqvmnrCEzV5plOeGqQb8KDZBliDSV1fsN/WO5s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=kvV5jRsVckhTk+UmuIMPxCXV7OhcsI7SSahG/nXwYZ/Mi5zBY1HSeqI9pWclt/736 ukXmQOmOchQUIQLwehdBTj33Vqm5LUBLsMEDKplLTRYygvyVDXiuiAWPHQXYI3D4ww nECGSdiZLAFxuSYuaQwoaB10DRoJksoRtyT9flbCXKCeW7UuXuF43Q3pMdRCl6OC9h FiqvqKjXh7tDWya+02Z2lf+ztHGaNdybJPqhyWOrLZ7S0Ta3gdZTmqkrvVf/Fpxs+J D41cNvWcFGrrnbQknpZ+yMeL0qVx/cN5NJHY0qzDaA/GY4xymyGMO2WgBvKz614g8I alJMzJ+uVhaYA== 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 52638C3DA6C; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:49 +0200 Subject: [PATCH 03/22] iio: adc: hx711: 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: <20240718-dev-iio-masklength-private2-v1-3-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=905; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=KAnU15Hk8iF1wb61OpyPO1VDqtC2h7HwECBSLVsPXIk=; b=i+RDahg3yTWSGz+G1qvNnmyIo/4Ra40gyIXDQbVIvpQWJPJ9J03N3niYrlONx1IpHfxvWDUzT nSrem2VyLyiCcRXlt2Z2CMZUjTHq/hovWoD9KWa1pU6dQHWyEBXreqw X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/adc/hx711.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index b3372ccff7d5..376f4e02de97 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -363,10 +363,7 @@ static irqreturn_t hx711_trigger(int irq, void *p) memset(hx711_data->buffer, 0, sizeof(hx711_data->buffer)); - for (i = 0; i < indio_dev->masklength; i++) { - if (!test_bit(i, indio_dev->active_scan_mask)) - continue; - + iio_for_each_active_channel(indio_dev, i) { hx711_data->buffer[j] = hx711_reset_read(hx711_data, indio_dev->channels[i].channel); j++; From patchwork Thu Jul 18 13:37: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: 13736542 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 A779413D61D for ; Thu, 18 Jul 2024 13:38:25 +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=1721309905; cv=none; b=jv6ucugVvZkSqG2N4p3QRqfStjx9VZgucmRli87EUNMoGXa4gxPrIre4PjvMQr7MxS1+w/AsrJjw7DYlQPhqmMDFqpyT06eQfvI8VQmp5nnBS72yQj0N8wqVAlZIM2yKEGDYioB24azpyrMue/iwodYEkyCOZXMZ7JOhV+2np9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309905; c=relaxed/simple; bh=rmd/tNcJ5Ty6WFn1GIPxuMT/8ivYAxSQAZwmr8zM9fo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n5bi7yJhbxda/OWHXjkaZL4vPDInW3jUsBzjxzIXtkMFn8k94Qzd1pbn6uB3QrT9Q+bGDEFlIEZOtQiEQw1gUyUuDJ6dkoagM/Hg+DkFOIV0NUKC3yDRunItt0/spD6FI01w4gk3sZ1Fw9m+OR7BunuGBo10lJTLCNzRcCKYkNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nxLCGtsk; 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="nxLCGtsk" Received: by smtp.kernel.org (Postfix) with ESMTPS id 68E5CC4AF11; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=rmd/tNcJ5Ty6WFn1GIPxuMT/8ivYAxSQAZwmr8zM9fo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nxLCGtsk/WJfJ3GLi2Ij+SOYhXybfVaq5MtM7tMCIECEXWwX6B9dY36VJaXYQog0P 9tjDicMm2d0nohaXMsZrTw1ubY54hFxwe/7xR0QgzwWd5N5qYKu6m9l8YpVYezMG4n DoMKWo2iZJiLr/1uHhiUpP30VW6Cgu7x5L6jYcoug6snJHMDP5AmWlCqXyN0udXSIt os1rNGSi89BzylerSk8x8m/jzu7QsANN/l9/CLPtJSet0pCnnLn5X0mQ6BcpLAaf73 Xmn5RPvdpZDJgNPdsFzJXpGxe7u+teY2cNerz7Q35ouXYFCYc3o4v1CTbHmddscXep 8GEo8X49DbLLA== 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 5FC2CC3DA70; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:50 +0200 Subject: [PATCH 04/22] iio: dummy: iio_simple_dummy_buffer: use 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: <20240718-dev-iio-masklength-private2-v1-4-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=993; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=/UO8BlopWO9kmVPYMQiw2xtRzt9uK+mubBziqer1//A=; b=oXw9qCYMnxtytq6HBGd4NwY68O+4p10py3M6nZ+33FC5VQJ7Qf/FVIO67fEdsWoqP7BP3WmA7 OEu7Uv6GvZEDkUcbXFULAQNYxW6CwAiev5zNjWbFAQGYj8lJRLGBXRZ X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/dummy/iio_simple_dummy_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dummy/iio_simple_dummy_buffer.c b/drivers/iio/dummy/iio_simple_dummy_buffer.c index 9b2f99449a829..4ca3f1aaff999 100644 --- a/drivers/iio/dummy/iio_simple_dummy_buffer.c +++ b/drivers/iio/dummy/iio_simple_dummy_buffer.c @@ -68,7 +68,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p) * Here let's pretend we have random access. And the values are in the * constant table fakedata. */ - for_each_set_bit(j, indio_dev->active_scan_mask, indio_dev->masklength) + iio_for_each_active_channel(indio_dev, j) data[i++] = fakedata[j]; iio_push_to_buffers_with_timestamp(indio_dev, data, From patchwork Thu Jul 18 13:37: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: 13736544 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 E14DE13DDC7 for ; Thu, 18 Jul 2024 13:38:25 +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=1721309906; cv=none; b=c5qAd+kvRBttMGwvnPJgv+8de1d+PsoradDr3AY8rgPdYOJsEA8Ls1lZFjlIswppaVehE4uc0D54Kwa7GEcv+0qF9MSLvBSnukql8cXoQqSllbYTkh1YjWc6HhDd+eTf1qKAsauimcq3jE/Qoa1WmPPonnNcJhvOhykGijVYPu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=Tuwpk/aqmBQEqJUdyzDzw6ui/akzpLbe+aopsBoMIJ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tn5LXfxvGMboP/JGK4VtMus+5S5im1xr/+DRvsRDxnC738TMYyd7kiYruo7IpRotwVzUYT8WwBEARUf2krcrcVHDIp3XKG1tWeD3F5W/BZOPJqWP/eJS4mQxePy+gV3VeW4km/Q7EH0Lp5joptiC8Ylhq1ngvLvZ6Tua0LKLXf0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZAKiUB+f; 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="ZAKiUB+f" Received: by smtp.kernel.org (Postfix) with ESMTPS id 78497C4AF14; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=Tuwpk/aqmBQEqJUdyzDzw6ui/akzpLbe+aopsBoMIJ8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZAKiUB+fejEl+d2cCORpN/bCZKETn8YdqcOrgwSXkWVRJTbam2YPpdKUR//LHUktb sXtnWiV+VOYP3ajAsFtmIMYXJfQmG4JNiml4o/e/oe+oiLRvJvv9Sgy/AazPTHoaXG hkgNPD7ak9NIPASvdkbqRNamwLFsNyhkGil60eU5CIf63pAqzdl63VEQf3ipKNHQmM 1KctJHnS6WMgUe6TLXYSDqPwuIvzyEdFWlZUO5tmultpByj7Rgqm200JfIimJnAUCg c0fCO02P3AB+Z67TtF6XrjY2J6IZcPpR2AUDAkQKcFd0E5zwDfKeBMJd9eR8wJh1Rn WgLIM3+QQU1Vw== 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 6E7A0C3DA63; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:51 +0200 Subject: [PATCH 05/22] iio: health: afe4403: 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: <20240718-dev-iio-masklength-private2-v1-5-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=875; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=6tp4obCLiDRZ8R0W142pAzIZiL2MQwENy2R1UHKy5HY=; b=yuLejtozZFgSU4xKAxP2iidJUylcr49KdPtdA4shuLIIzE6LFDLJrQykH89vmClPIqhhVwgyl G6fgUkk8OVmDryS06iCSehJDrTeowtp9Z2ehJ5BLtQti0Xvj8MLH1xT X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/health/afe4403.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index 52326dc521ac..85637e8ac45f 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -321,8 +321,7 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) if (ret) goto err; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = spi_write_then_read(afe->spi, &afe4403_channel_values[bit], 1, rx, sizeof(rx)); From patchwork Thu Jul 18 13:37: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: 13736546 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 E151913DDCD for ; Thu, 18 Jul 2024 13:38:25 +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=1721309906; cv=none; b=FtboznfGCETZLDDQKKRWKSEaGBvmf5ued7ipgaOcKXcbeRMoI6x6FNp3jSt6iAYoJQ5GwpvLKzINd9ffomgYG/J4tZe2lkpeFtC6/Z2FQxho5TefZnS+wKDgM0m8+4VibXf16s/MHGYpCw9KF3ePiZc9C52cX6mSgw2D4qYLXHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=QDfskd2Rn5sHaRakewp2koWwwbec4LNG3BpRSildkBg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bFKOWIYgY7jTFFD4kL/YOVybGZyjGe1Ij6qUQJaY8m/EqhUYS8pShwZybfXCeem1mYiMXc2R1onNBD0f0eKURYVeCCS/3Gz05qzZl1Z5gIoalEb8k1+KgUui+qrRvFV3/Pb78J/qV2yfFP4q8cf0hnINC73Zdh6A+2mTkCzReX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GUrI2vbS; 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="GUrI2vbS" Received: by smtp.kernel.org (Postfix) with ESMTPS id 84E54C4AF16; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=QDfskd2Rn5sHaRakewp2koWwwbec4LNG3BpRSildkBg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GUrI2vbS57rikAUupMDAUSUD2vcv7IhJCIjTwtQiwpXRNVpm+iep+KDD9s2Rekskk qJ7NTy3/nqd1f2vToa//YXUAcwdWlWuv+8m5JfsnV1EtunI3zPWaBcLMNEin6DFkRY cF/YwtERdbNqBkH009aSwmz8sGRn2/04bDwBKmcj+t1odFgjtmHah5psD2v5feaqT+ mBxeMEFYndHyXE6sdOVFwmTupcvAJjnrFccE8QdzLsAeQxeVz/u4K16NvLjG3bclj9 Tbp9+24z8IIeW/x0oq+yT4/Jxkr+0KERIbMUad0wrR2sKbMkn34QEwX4qYi2zulvwp O+9sXM0mQNs+A== 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 7C276C3DA6A; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:52 +0200 Subject: [PATCH 06/22] iio: health: max30102: 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: <20240718-dev-iio-masklength-private2-v1-6-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=863; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=5H69UJpKUwhjYrie33oP+IHHh9ZtV6RkXSkhlBGw/AI=; b=LJwYzuHnG/NrWF7XM+KhWCZVueUkEEQ3LNJ2lO7iP/9SoPXyXwIZtaGzQtgRrFuLn/MtuBaW3 o8AR5sFGOstCjFKOxJtlFNQz096VzVTFA8XKJXSday3GOklaQUqKW58 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_get_masklength() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/health/max30102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c index 07a343e35a81..1d074eb6a8c5 100644 --- a/drivers/iio/health/max30102.c +++ b/drivers/iio/health/max30102.c @@ -293,7 +293,7 @@ static irqreturn_t max30102_interrupt_handler(int irq, void *private) struct iio_dev *indio_dev = private; struct max30102_data *data = iio_priv(indio_dev); unsigned int measurements = bitmap_weight(indio_dev->active_scan_mask, - indio_dev->masklength); + iio_get_masklength(indio_dev)); int ret, cnt = 0; mutex_lock(&data->lock); From patchwork Thu Jul 18 13:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736543 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 C1D2313DB99 for ; Thu, 18 Jul 2024 13:38:25 +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=1721309905; cv=none; b=gYpbVvyQFRN8hsnIrnoYcajS5vWRhXLZJIKiSWVqFlv/FoJS2vjdvuCtYSK7o7LIL28lgoUz18alpXm05lVMFmRcrqIsuueYUF2yMPEaF57TUmKdh66bo11yQ1mcy2Inkm30hdrqBf81K5XglbR1+GPHbRKSq+t37r8q5KeQiuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309905; c=relaxed/simple; bh=ZIj87dEsNvr5PhxdEedZ7HdumCOccZVU/KKk+G3Pv00=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BOrWR0Oz98tqc05oL/EmjX5HOC+eUGpxj12ECJxDQFjhAqz377vQ8/CSCkhYtYwzjacd9adj6A1MUxmPVQJCltDm9ZnJpyQUx22dk9ncFuhXYptv8Cw1eS5OnPpDkICGd9YPyBgnM4tU5goqmQgJZRy/MOIV7VO3enf8oxRQt8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WBkZTNsV; 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="WBkZTNsV" Received: by smtp.kernel.org (Postfix) with ESMTPS id 945B8C4AF19; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=ZIj87dEsNvr5PhxdEedZ7HdumCOccZVU/KKk+G3Pv00=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=WBkZTNsVMvEx81gu8aS22OPRJsZRaCNXE5QJaq4a23C/H/IsK+fwQ0pxQMcLhIB+J Axs2xpl6DECvK/7xeyVXz9/oRe1noxZVLgD5ZxkWZv1u3U2XSaMl0sEYmDEgfargMz /P0niJx0MORg/0AlSBwhXgneKj1Zsg8OwMqwIrFfGJZLBNE2Zn3tqmFv8um/+vE6QE qrqXef5csFJk3iq0fzx9kNmIs0E0Zs04XpdK++JOnO2B61O1n+ltVWQYciMB7m+Amv 9AvkwNe+DMsNPaBFBcr0SU4ZHxvNTmfgt5kV16BBvQr1DdcAO4czoCUdvzEfmcMFfU Jrz/fNCYJFy6w== 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 8A0BEC3DA49; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:53 +0200 Subject: [PATCH 07/22] iio: health: afe4404: 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: <20240718-dev-iio-masklength-private2-v1-7-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=921; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=T8qh+PucTketG3iHEIzNlvaeE66dT5WhEuTq3tBVE18=; b=87ThQexREmQD9OsoxEDEcew3xLfOuwEiZ/+vDMFUHIcctR38EC2SAIhjO7h4nvlXa6+C0G2f2 Bh2KsGXQzDPAm+ihbhwBddTlt+siBg3PVwgjfbSMD0yhrB4QH4fmNtr X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/health/afe4404.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c index 7f69baa1ed53..d49e1572a439 100644 --- a/drivers/iio/health/afe4404.c +++ b/drivers/iio/health/afe4404.c @@ -333,8 +333,7 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private) struct afe4404_data *afe = iio_priv(indio_dev); int ret, bit, i = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = regmap_read(afe->regmap, afe4404_channel_values[bit], &afe->buffer[i++]); if (ret) From patchwork Thu Jul 18 13:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736547 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 E876F13DDD9 for ; Thu, 18 Jul 2024 13:38:25 +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=1721309906; cv=none; b=aYaRG9c2z5qEV49AzfnAjJhux5w5KAnE3Qxk+Y+0wCgnHWqdJW5aK+UI1P/SoJSY8ZacQsrTx6t1neA+YSw3JFJyru5N09L1iPCGSSUsH2222UjK3wo1qHqC6YqsJv9hTKfrMjkeSNx8vJYrioVpEkseGE1diqnMF3wSUGfHy6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=35zwJv0FwMSgv84/FYd5MG0nOxNCuNaUIxyUXC5BwAM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RCJppN4WnGXODkwlMcVVgKHCwFMQeBRPiYBkj/xwH5rSpqKUJ7JWFmFg9QwTgbMEG+HXHzaXDcTjsEevyxGEqkPqSFowbOYeLG5y4cvZQN+J8o4X+7tXI6dq2xMoBurfPhRpeOT84JEwJ/o7cHGDYVodOmq3EOKy0hJ/6yLh4zo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TDxdzADX; 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="TDxdzADX" Received: by smtp.kernel.org (Postfix) with ESMTPS id A8F68C4AF1A; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=35zwJv0FwMSgv84/FYd5MG0nOxNCuNaUIxyUXC5BwAM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=TDxdzADXqF1TL4Zb5L9g/nRslFSouWsGZDxwLmpqLSeIjyqZTUmP5fcojwW3deS4I 4NSmLpHrWRfvRcEc+jtDYcBJAgvrDQ8iD2fVwrH3SbCiNTpIpOoRTzQ86cVfmuXab2 CM268BUvi5WpSzjsQXNRZ3OBCcSmJxA/McM2cfpd8JhNcIIlzV5AGrgoKs84bRMt/6 17ftibvYhqieueu458Yv7jYdO+8cMMwi+5M/isHptZ2Vse03TUsA67Btvl6CLBHrFr vNzxErnS31HKCuEKWy4x0fFHDV1Eyv0LPhlUqsWHFFkJ1peHsaODW2DiVe6v9dobGc 9IlJOi4H3TPIA== 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 9E650C3DA63; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:54 +0200 Subject: [PATCH 08/22] iio: humidity: am2315: 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: <20240718-dev-iio-masklength-private2-v1-8-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=916; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=v1J9CeLrZGFCPkvoSSiWK6wlv3vsQ+PI5KbphUEl53U=; b=Ztg7v5y8eCCuJgT3EaRbFW3AJPABX5Sgl2lxvBXdr+eYOxsmItf/J/RBrmmwM61bKR5PmqtCx +3ZkoWmV+N8DQBCyJvsclCOEYiark1NI9T6mll66N+WOKE/QwNQ8w6O X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/humidity/am2315.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/humidity/am2315.c b/drivers/iio/humidity/am2315.c index a56474be5dd2..6b0aa3a3f025 100644 --- a/drivers/iio/humidity/am2315.c +++ b/drivers/iio/humidity/am2315.c @@ -174,8 +174,7 @@ static irqreturn_t am2315_trigger_handler(int irq, void *p) data->scan.chans[1] = sensor_data.temp_data; } else { i = 0; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { data->scan.chans[i] = (bit ? sensor_data.temp_data : sensor_data.hum_data); i++; From patchwork Thu Jul 18 13:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736545 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 E873313DDCE for ; Thu, 18 Jul 2024 13:38:25 +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=1721309906; cv=none; b=FIQNd0uqBqmhbNAiX+IADcDIGLmLGri75D7fZj1FWGv3xGY14n5GlScfVlmLGapXOxp4UqJEEemnrQMYfX6vkwWkk0cCNfVKYVoGSR6ipXY5XrQ1W6JN50POxSlFjRqX3nEBZSvAcLUmGGS3MhOeuwz+rWJW0yqvnn83CcS4ILw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=t3v9pNREQW04rw1bPr4IKujLCrhaPczP09b4jgHutKI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bdP4I3LqqYIW7N5jnkc74FfRX3kgnWJtot66rRzWi84yE62xTm18vKBEyML6k0CK0SiEfUgrtkLynrKFIcwxq8RiM0sFbkYX8HDOiyabKjJ/h7cUIe0cL5va0oB002ksHSXxselKqhBkeoecdyzvH4nVVL5zYzhCrhIMG38udgM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rOo7cFdG; 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="rOo7cFdG" Received: by smtp.kernel.org (Postfix) with ESMTPS id B783AC4AF1C; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=t3v9pNREQW04rw1bPr4IKujLCrhaPczP09b4jgHutKI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rOo7cFdGik/mi3vFs/0cIapk3wb80DiYPqCiL23O/BikL+NAOCOZi3DpN5cRVKRrS gtpaultUuO43SnEu3rzTXvAJrHFQWpn8w99LSDH2GfoOBugWXDVHy32y0+ENXK9itP Afq2ZZVCBRkqI7JTslRiuHxffi/wCUjsSF1K74UWOJXk2OkxydG3MuQFB54ty1WeMx 9T5KJj67eg0ORyiCNUw2cEu7YFwSzNhtxZ9I5GGjJDgafoBf5+Cngb8g4FWGCDhRgT GT5f3zGgALnsMirTro7ef7K8a7knWkT1eHjixloWsVSKCmpiUei2WHDxNwoqsA4Oi+ /mDjB9fc2Nk3w== 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 B201EC3DA6A; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:55 +0200 Subject: [PATCH 09/22] iio: imu: bmi160_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: <20240718-dev-iio-masklength-private2-v1-9-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=968; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=FCLyiHnQTa3nd6JpFgp4oW46A/SnReH0cNLG6fHRNAw=; b=wAqC8oxgdozzLH8C2SfoiJq+6J85sx9mKJ7L2mzkWOcQ7si6k3ztMmcr8CiKOqN1c2SQcYG7H MMc0dTolNgMD0ILZHAEaD1VDw5WrQNtVsdoN+BrQSQt7TWKLnzS5gD0 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/imu/bmi160/bmi160_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c index 90aa04d94da54..495e8a74ac676 100644 --- a/drivers/iio/imu/bmi160/bmi160_core.c +++ b/drivers/iio/imu/bmi160/bmi160_core.c @@ -435,8 +435,7 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p) int i, ret, j = 0, base = BMI160_REG_DATA_MAGN_XOUT_L; __le16 sample; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { ret = regmap_bulk_read(data->regmap, base + i * sizeof(sample), &sample, sizeof(sample)); if (ret) From patchwork Thu Jul 18 13:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736548 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 E8D9213DDDF for ; Thu, 18 Jul 2024 13:38:25 +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=1721309906; cv=none; b=PPIcqROhmqfTR3kfGK+jfyfB1qAtvqtgPy0h4srIP/RVfqP605R2OHw7Tb4HRcBLuOrI+yywQlNZNpQryQOvzlYWBr7P4zvtpRMtfGEt41iYXudu6bJMbTe2ypuMzPmIqVaV2i8B4UQjggiUYBbXg0NKkDsBe9G0sJcW0nih55E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=I5AfYMQAlEpQyOmlRKg+FWIU6S55d3uDdSFskbUiEWg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UBRzh4ETLf/KfKZZ4B2/DAtt4cGI6Crl3bi5jannPjVQ4JeDb5KdgcT/qBA6ejrVYH43UGppudjBHmDfzTF8EC7XDnfaQ2TEdvwIruuQd8zNFzsM6IyBC/VA1olxohhmr/WE1gTb3ngiXh6ERaynD4NHAvuLnJ2ckJg5ZoNL37E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eyfS79tC; 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="eyfS79tC" Received: by smtp.kernel.org (Postfix) with ESMTPS id CA7C9C4AF48; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=I5AfYMQAlEpQyOmlRKg+FWIU6S55d3uDdSFskbUiEWg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eyfS79tCsq5y/5wMKSDH0Ie5lROvJA1xn+OasOjbiDfb5+x6b3DfF2uhI71TfiAPO U8Tjb2W0kTQb0DFvv0OECTouF/FHRyrJHt0x9o10j0LOgP1finNu6n95AK2wLy2JKM sn/SSGIkzptuf6yIWqp4Veb0fDQlPdirjaWTXJgU7iRuHwim7my5ACMXkx2r+azzBq 1X5+B5xDWXvJdNnwP/vayZlo/b9rxoUTgUcKd2dZNTIlaABbdB0f31RkMeQkqMgLSk H1vkeilSvvdG8rT/MvRSR0Gcwa4qEyy/b6rxNy4mmdTG6HtySpIBomPtjfRsbHUb5K M0HIBM+I+SU/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 C2E24C3DA49; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:56 +0200 Subject: [PATCH 10/22] iio: imu: bno055: 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: <20240718-dev-iio-masklength-private2-v1-10-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=875; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=1/XFhtVL5DGGEIfobJIiiBmxQTyc/mcom9KHRuSBMrA=; b=m3bFh284R2Gbd8u35dz8a4JhrMysfAJFI0MrGa2s8veAnk2+7opnBOFka/X4WIVTrSjmj78QH MTlzRQEAIK5CfZrWJN8lmaoeXtcFckO/r9rfCuXoEznZBHV5OC0eu7P X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_get_masklength() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/imu/bno055/bno055.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/bno055/bno055.c b/drivers/iio/imu/bno055/bno055.c index 52744dd98e65b..ea6519b22b2f3 100644 --- a/drivers/iio/imu/bno055/bno055.c +++ b/drivers/iio/imu/bno055/bno055.c @@ -1458,7 +1458,7 @@ static irqreturn_t bno055_trigger_handler(int irq, void *p) * then we split the transfer, skipping the gap. */ for_each_set_bitrange(start, end, iio_dev->active_scan_mask, - iio_dev->masklength) { + iio_get_masklength(iio_dev)) { /* * First transfer will start from the beginning of the first * ones-field in the bitmap From patchwork Thu Jul 18 13:37:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736553 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 5681313FD86 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=qjCJ3uA4fLEV/EyuyYaC8BqwCV/A3Id67rQhkpA21D0UjA/EMpnmpTL1Ly0j9W2oQaftdwtwEx8+AP5aAi5bYYm9FleAMTWz3DdadNBqMEkVw/nMhhqqDPk96fGY5AwbJKiqaZzCdx4QH2S03hxhvVOWxuFvK7NWh822pRGLTy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=hnw4D7tYJs/lNUG7FxnAHQ2n1aujDPyAd3TKm7yRzNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gGkcWs17zc0yvEPyWSsRON+ckqshcUl3O3X+dPfg1Or2jiquiUMt+G0EW9uTleuO5wEJzxMco66l+HrmgGAQFvsPV2nTCwyO6MpLyTYHXpLZHiqlhNIkKwxGTHkUByAiyST7KBm+fPZoX2+g1wd0NCGcS9x1FVCR7aG+FESGix8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V0O50lN0; 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="V0O50lN0" Received: by smtp.kernel.org (Postfix) with ESMTPS id D82DBC116B1; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=hnw4D7tYJs/lNUG7FxnAHQ2n1aujDPyAd3TKm7yRzNI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=V0O50lN0HbvhtgV8/2qFKw+I/d3qHxWq6kk4FPZI5N5p/rf55EwOu9gsiTjPKSTHu kr2PLUWY0rMfiI0M2iPoOA/mtUu+3jvgg0pzz90/tYr21il+lYqNB/OP0tiDjzVs9b lTmzbfQGJBPqJ0IWVqWb4qv0netHkE/caYz9k1BtQfVtQGMy5M2JJVYN957x4a4wEi NyEZsmOFW4MsOsApibfQz2Y2smwtaQJdjsn6xc2glJhdVCkN/Rf1DarkvF29jNvrlf FTLNjBvuBY9uTD+TTThEagVSlsWfPSRBmaYpKuxgBbWU4oi+zsgmujn7e6CEWT9p/P 5rmwM7SX+/r8Q== 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 D158DC3DA63; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:57 +0200 Subject: [PATCH 11/22] iio: imu: kmx61: 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: <20240718-dev-iio-masklength-private2-v1-11-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=869; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ggyixMIF+6oukTLiM3iRmoyaIesgRCWO8VE0DMlpAmU=; b=29DDxZq8ouN0wfai8KNE5f2bmxSOgwxe26gNJUGhNOBvqQC7tl3Q4ycsxB0mpMCgWmLKEIgoC 3OQtLIwVFxFDYaRTLJ4/PHBiNSzfkKW0aY+erQemUMed8sq8ejCWnni X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/imu/kmx61.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c index d37eca5ef761..c61c012e25bb 100644 --- a/drivers/iio/imu/kmx61.c +++ b/drivers/iio/imu/kmx61.c @@ -1200,8 +1200,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p) base = KMX61_MAG_XOUT_L; mutex_lock(&data->lock); - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = kmx61_read_measurement(data, base, bit); if (ret < 0) { mutex_unlock(&data->lock); From patchwork Thu Jul 18 13:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736549 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 148AA13E3E7 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=rz6rqvH/kcBXQ8QGhNUviKbg5rCMrLUCnESTyO/XUcDJy9vVgFxnbfOWiYEd0LzPgRhGrgz9rxm/49d3v/1Vq4d/h28dr1unvhCPHn7JuXXeVXdb/qk5jUOJcdrNS8CCNWwLRdUzE2a5JkhVqt9z+NNxKAYhTXIVvOHSyjZozqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=vwHm1+s8MZtQBVXyjwCqSe5P3D4ZHVEifY6/zt59ycw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rpIiPXuAzYwl0hSgfXxq/Scxcpc6jFdsHJH6oQ0Wq2O8IuQ3Hzd9dw19VTA+djWhOMmX88aZHRYVIswfEaW82PRo+8TGpgqj5WydpU7ElreIq7+qY4aq/axk6lltgS7OfBktRGbwBwjWtSNSwZZvHZC9ikyWk4dFEpFZ0NtBNAI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C0hqtEdd; 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="C0hqtEdd" Received: by smtp.kernel.org (Postfix) with ESMTPS id E396FC4AF4D; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309905; bh=vwHm1+s8MZtQBVXyjwCqSe5P3D4ZHVEifY6/zt59ycw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=C0hqtEddwGKdmgSTR0bh1IFL+IE4se9/hzSvYR5ez14nnpDEQMaXh3rJa4TdtZOY2 DKn2rnAswYHt2NGOnkpn6UG0wv116sYY7jpFK+wON+0O8qk/w5MpZi2SmxXA1MmRQv UY4+f8QG1xvDkHH1ZIFFA4Y+mAt7qZ7snYbnn/MGtP/fJ/pcSC0dwf++TB0PdN8vyp ichb+8w64DNcF1hgtiS0jVJnWfOHLVlb6qyd5L1RJjO8uImpwZtDjP35Ui7/BqUfDm PM6EtEMQ9ZFM/lSrtoIjyV36kC9EfTWgoni57DVFGoY+2P7DJee1NWRb65evCfC3o3 Yn8D/ZigVFmOA== 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 DD69DC3DA6F; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:58 +0200 Subject: [PATCH 12/22] iio: light: adjd_s311: 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: <20240718-dev-iio-masklength-private2-v1-12-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=864; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=TSHQtCAOvetS9PFuXHMtMqGj6a4Kr9MMSY7AM7lvy6E=; b=Ochlt3MUUEAbTKL3DZ+k2tTqiOIXNbQgvZgyAeiR73Zee8PSejrRu3z6DifLNXJhZsanab8xM kSIwYxFu1JzDikOBLBG4YLTmKtyXRUDeUnvltLAgo87N5B5A+nOj6p/ X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/adjd_s311.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c index 5169f12c3ebaf..c1b43053fbc73 100644 --- a/drivers/iio/light/adjd_s311.c +++ b/drivers/iio/light/adjd_s311.c @@ -125,8 +125,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p) if (ret < 0) goto done; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { ret = i2c_smbus_read_word_data(data->client, ADJD_S311_DATA_REG(i)); if (ret < 0) From patchwork Thu Jul 18 13:37:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736550 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 19DA313E41D for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=l+ZCbytK2deVkGDoSPuoxtIcWYpGe/z0Dv0wwDQC4ieOL5eYnUgYdftHYnbUg3YdIQ+QajNQw+Qzo1uzGisc7uqMQu4ZcVSBy/XLLODNd0C0Cpkx99YD4CrtWwMZHfYAaRnM+IajRBnRK34t/gfEjWcomivJWK20LUy/KNVjLGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=NNjQN7J2L7xaT3aQ9I7ub3B8qixiSexMMl+KIPF+d+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hquUbnLmqOXE96dYleuQYkAbFcCYK9lapbyZ5bc3hFOB0Sqhkl+J8JqURhA9RMVTpz40KjtZ0KYIN57GSlXEQDJ344anP/CacEMKOjYIFkntNSV5O8iJizro8q6l3WyZXRXWiKGR/m2mlFGxF4szWn+lwbRXxsEj/VvXMHJMY+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rmznzegh; 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="rmznzegh" Received: by smtp.kernel.org (Postfix) with ESMTPS id EFFD5C4AF50; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=NNjQN7J2L7xaT3aQ9I7ub3B8qixiSexMMl+KIPF+d+8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rmznzeghNiHLKRwYj+aK9aOAUbOCLHLvhpykOIS9qFXqAnLjmp3olduOP8nQ9x+h4 0/0kxQ+EPlE32gmDYiBnt4q0LzD3HNNe7SqAEYp+LDeotQJzngnS6pFCILxw3clnar t8/bsFqR9WGiolJRih/GIt93E3SAj1IQEjyauMpwYE629pD2idT+8txhJLIYBprNgj grzjC/jSiEaOyKWjV3otp/s14Dn3KdRHmqp9M/wo/trzOHgfQ52C2IQo1FHyA6k6nG RG3aH8+xRsDs+Jx7Zuz4+zB1aluN0QwQIWwhoZ/vo4uwia1EUsrcsym+yPTU+o3c2F PJSw1RYY4FoEw== 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 E7A75C3DA49; Thu, 18 Jul 2024 13:38:25 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:37:59 +0200 Subject: [PATCH 13/22] iio: light: gp2ap020a00f: 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: <20240718-dev-iio-masklength-private2-v1-13-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=1716; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=iVAdgQB+Z4IwxRK4KcX4smk+miW5axW1/Zjw6uLW21E=; b=7K8V1J0806sMudf1VLaWcWBtMWSwCfjZ1Mly0z4YAGqDqP/2zcvrxhbjm8eAGWGeBRexmZ29P /i01BwZhG1VBTPVO4Oc6bvSC29pJ6D9t7jE78bSzDlT27WA+/yhKddQ X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/gp2ap020a00f.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 757383456da6..b3f87dded040 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -965,8 +965,7 @@ static irqreturn_t gp2ap020a00f_trigger_handler(int irq, void *data) size_t d_size = 0; int i, out_val, ret; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { ret = regmap_bulk_read(priv->regmap, GP2AP020A00F_DATA_REG(i), &priv->buffer[d_size], 2); @@ -1397,8 +1396,7 @@ static int gp2ap020a00f_buffer_postenable(struct iio_dev *indio_dev) * two separate IIO channels they are treated in the driver logic * as if they were controlled independently. */ - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { switch (i) { case GP2AP020A00F_SCAN_MODE_LIGHT_CLEAR: err = gp2ap020a00f_exec_cmd(data, @@ -1435,8 +1433,7 @@ static int gp2ap020a00f_buffer_predisable(struct iio_dev *indio_dev) mutex_lock(&data->lock); - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { switch (i) { case GP2AP020A00F_SCAN_MODE_LIGHT_CLEAR: err = gp2ap020a00f_exec_cmd(data, From patchwork Thu Jul 18 13:38:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736551 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 2A98213E8B9 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=o6P+OxsnphrBGMBn4KLGOGd37Hu9U2iHcNYzEqhhZ2Dvl0s7i/BmP0ASp9Q6O15yKCibwOuUB62afz4cOJDDo9m+yCIyfeVBRAdGoY+RgVMYTOPr0hF5pF6Sok8X3ITpNG/gFsZdBfIme2Dm7FN5bFpHOurx51Ej10ulRPkQjNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=45TS8RkS199cSqf+bQSzXlP601ec3UlzuKJdaG/BQ34=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fSNkbFxb/PZ+Xbc0mlMISfVCmdRm/SF6iRkfKbfovHKDZxgPUAfXKb81Q80ekkDVvb8ClOZkzWcPkazKrstes3cqO2k8aQ8nDXCo9lbCoHbduv1qfVvx3ZLNYe4R93YGlfUJOB/9nDR3ae+f1ebJXUmMmygNApDCKGcV9OTXyxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i3MU0G4o; 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="i3MU0G4o" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0CF30C4AF60; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=45TS8RkS199cSqf+bQSzXlP601ec3UlzuKJdaG/BQ34=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=i3MU0G4o/d2pvTurpYTVBUcNRHKojCyACYzI+ZiB3/PWztz2MAyn6+aO/kvJ1ZawT 5dx72eJL5ddUej77qc9HzPRiVSz2lW8KFoYrutBKo1O5anlGYcKg+BQQgdWSl1YHrq X1SJbx9NjddiFgK+jfX0JnTOHLrBRPGW7/aTafT5VqVEbyqilnAgXIWzjk3FXpeUo0 cWV9xRok/25o5V/GApkOoE50jcbvZzO8fiG3QWrNbIikdPImO9vyROZIm/qxdg08R8 PjqyWrsr+5cgOnRS/y+kr7NvqhCNgBLlV7w02pM86EmBmPu86uPCnG4PxKedvc7D0g htv8Fgca1czNw== 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 039D3C3DA63; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:00 +0200 Subject: [PATCH 14/22] iio: light: isl29125: 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: <20240718-dev-iio-masklength-private2-v1-14-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=899; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=44r1OBRTeVEJ/5KHZVThUvH1dW1shD4ej8y1KV3icWw=; b=3uR4X54aZ70UqR04TwiESV4WFPo/WoLMFnVDSgzhLJzHMYCMs1gQqO4QjKe1HvVgXICyXouTy WSm0Oas/rkKDEn6ViCoLXlQq/2lo27TK9TkcL4QAmCmHtlI2U/KOnN5 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/isl29125.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/isl29125.c b/drivers/iio/light/isl29125.c index 59329546df58..b176bf4c884b 100644 --- a/drivers/iio/light/isl29125.c +++ b/drivers/iio/light/isl29125.c @@ -181,8 +181,7 @@ static irqreturn_t isl29125_trigger_handler(int irq, void *p) struct isl29125_data *data = iio_priv(indio_dev); int i, j = 0; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { int ret = i2c_smbus_read_word_data(data->client, isl29125_regs[i].data); if (ret < 0) From patchwork Thu Jul 18 13:38:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736552 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 4E9DA13F458 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=BuMihlOjhMqC55MTU8XSxCp2G4iI5Ct7qJwdkbO3kwRZRlHb9hp/4w+fPnpCjQ1ybdAZb5x+wVmOXT6ZDg9/m8z5pCYSY2Z88+kYChIzGwvEsZUpp1bo4PSxzz1qODCJXVsmO5jkeFk9OOj5IBqJ58XSI4hlRBhngujyPyMB2V4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=UgKbxbF5c4DZY1lwDPltIP9kygl4/Xtb1kDsWdz8cPw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dHoX0eLloH7hsUkm/FgtE4hvJaf/gFJWaORqaKHS2W7ESZ33b2jiDtcVhgV3lSJEPK5zQjxslE4TQ3vg7N3+Eexp6nXb9TRWdmrKnyUtRps/G9kcgtyLAl6gKo0XizNcvAqGxGA/Je8Ng8XTL2lYcRI5agXN4AzD1Qp3cFpn4fo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YbG531Ba; 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="YbG531Ba" Received: by smtp.kernel.org (Postfix) with ESMTPS id 31075C4AF64; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=UgKbxbF5c4DZY1lwDPltIP9kygl4/Xtb1kDsWdz8cPw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YbG531BaH39xK4Kz1BcTJ2p6lhrAqsjW1xX+gj2Fs/wSwcvUPdUDw796sPZWnnbCb bVtC1fvoVZ0lFobpMwLMRA/VsG8aChFQgiebBz0PSxs+Drj8VL3rVoIMQQBOoGOyfM HeRj0v37EiNq+AZxd6QcsaHUoVcNbnahQZoZJ+CYBph/n8Dx8FXqMixFH1oDLaQPWc cyQayAX0S6RgvYsT2wFmNntiGaFq/mW6CMogmrBgulD5Y+YfPCB7DyYdh3GvBQPuX9 6n9ZIW8SfNFhk0BW71kHKJSsatxXYmTCe/pkuHIJNg7RTplJHV+a5WcxoVAK6WczmU Nf6G+GLgMZRRg== 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 26ED7C3DA63; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:01 +0200 Subject: [PATCH 15/22] iio: light: si1145: 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: <20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=1394; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ydCEkP8JsRVtoKR9bEq7QSVO3KXJv8WNwFnv2eEpBeY=; b=gZ6IUQPm0/RNFe4OkVKzRf1jtalaFetYLzAUqhSgt7EOB8gDOEdPWgEnTdO+raWTHyqKzp8pr e72dFK821ICCkLHVQj0FpYw962mT8CAa63j40Y2vxjthY6FmoN9f7SG X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Make use of iio_get_masklength) and iio_for_each_active_channel() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/si1145.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/light/si1145.c b/drivers/iio/light/si1145.c index 77666b780a5c5..66abda021696a 100644 --- a/drivers/iio/light/si1145.c +++ b/drivers/iio/light/si1145.c @@ -465,11 +465,10 @@ static irqreturn_t si1145_trigger_handler(int irq, void *private) goto done; } - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { int run = 1; - while (i + run < indio_dev->masklength) { + while (i + run < iio_get_masklength(indio_dev)) { if (!test_bit(i + run, indio_dev->active_scan_mask)) break; if (indio_dev->channels[i + run].address != @@ -514,7 +513,7 @@ static int si1145_set_chlist(struct iio_dev *indio_dev, unsigned long scan_mask) if (data->scan_mask == scan_mask) return 0; - for_each_set_bit(i, &scan_mask, indio_dev->masklength) { + for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) { switch (indio_dev->channels[i].address) { case SI1145_REG_ALSVIS_DATA: reg |= SI1145_CHLIST_EN_ALSVIS; From patchwork Thu Jul 18 13:38:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736554 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 5D5D1140363 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=NVdIQDIN2s0tQ651Gh6HkS7iiPhrOxGVI6OiQHg21wvejZXJ/n/LKX76JzMy4pq1Alzg9UotmkkzbXu/Q9tT/8yUonsfZq9xUp45+mLXNG2Xw03Kjovy5xUIJl6zcY0i0zJqQEjEMyjPFx1c64eLbPPxGxqOIbDKvXsiSybiHPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=HcHYJCuITFenps2794VjTZxgqRMuEK7mV7GELGDD4R8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MZTXJAg9er/Obm17U5MsY/yjlufZnH87HOYS0h6GmDywu8+99sG+AjuDoTSAhb2ayWj7NvGNEjQpu+RXFUmtSE7+Y3MyXRQry8Qu6M1pT/SIYuiBjI4FDT3Y0GxhxzMdzi8Mtit1UkNhrSHwetnaYoNwdDClEBjYsN59uJd1mK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jD+V32Ri; 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="jD+V32Ri" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3EF48C4AF13; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=HcHYJCuITFenps2794VjTZxgqRMuEK7mV7GELGDD4R8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jD+V32RiPPIOlWXPhHUlwW3ZCzPxYjKqKS6+FT0tEen1+6JSL9KFhj+Wxy+0nDjPf UlTLrmIxCfbvE0bu7ZKLc+Fj71h10ISi/AlhXKH3hiKFKuV57mYUlDD0Q6Q4Dlp3ZF rTYcW0gE3rK9RbGtTMIwvAMilrTgj6hsFN4tisocucuMQHsoVTdsDgsD2K7RugpQa8 H+dVtlU5ZXybzbLcN3gcGz6ctPMNoknfYCfLB3v95j9jzAHlWKtqIjHcaH2I7uPeKP z7tLPYDunaQzgPJkGWDMlTZhIE5mUuH+c8V6HhtJKKJWlW0xTZgsnwvZPB5/k61eGa 50Xyt6ui2ZOcQ== 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 34256C3DA6F; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:02 +0200 Subject: [PATCH 16/22] iio: light: tcs3414: 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: <20240718-dev-iio-masklength-private2-v1-16-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=895; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=FQPoPlxTckobGJ/E9BiUhJ3AOag6kmtMKp8GvAK96A8=; b=XGy1BTl3TvcwxZ924yiZ5ewtZ7TLHwoYgL6uYjfGMrZcrWxANdgK5Ym5e3BmjLr8bVWS9DWf0 0jzfDRIuyT9CXSWCmTE9CkUUVQGnpjh9p+U6xjFEh2KwPnzWni6ujAg X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/tcs3414.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/tcs3414.c b/drivers/iio/light/tcs3414.c index c9566615b964..4fecdf10aeb1 100644 --- a/drivers/iio/light/tcs3414.c +++ b/drivers/iio/light/tcs3414.c @@ -206,8 +206,7 @@ static irqreturn_t tcs3414_trigger_handler(int irq, void *p) struct tcs3414_data *data = iio_priv(indio_dev); int i, j = 0; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { int ret = i2c_smbus_read_word_data(data->client, TCS3414_DATA_GREEN + 2*i); if (ret < 0) From patchwork Thu Jul 18 13:38:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736555 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 72D0D13DDC7 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=cTxVtMGaXBqI9Xppip9WxPgpVz9P2lxLSeUDU4Ul4msxO7V2u1Ul32g4sRD4YAPU6i/NQiP68HBrxnM5G1EGpf1kEQt8cKubPNQQrtk+XQUyZUER/bQDgj2tM2ztW/c9caw15wfEg1idcWYptaoZW0iocPB9l6z+SQapunP2Lg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=hMRXI4Sv2LfJ5Fb6SHSsAO2Q3C00WA2SOcEUFsjlT7I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EWzMen86l8slETT8geytAfNO8UOd8YxR5H2EpUegEKE+XUwXj/aMX2+ar1uK5yHzNM/sUOkWiEiN5yMNhIfTxpPsppiyZUZ2e9wYor1OPGA/oMBVI/1Lg3XgaXkIxvg7IpbWdle4pX5bxvup20PeGx5poGPgCAOFCIhHT04bR8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y5swMhwz; 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="Y5swMhwz" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4F82FC4AF14; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=hMRXI4Sv2LfJ5Fb6SHSsAO2Q3C00WA2SOcEUFsjlT7I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Y5swMhwzEz535svPQx+xu7wFoY0ydFamrTpwIIn0beldKSSNKI4v7ln8wFi826PAA o3rMdysaCRyOFxKtZKxyl/VDTJL8C5jRyvVNQMBXel4gkdezc1Z4u5L+c0isr5cRnE CWrKk8zaYxRoA3a9N0F9gIs0VPFv2g77om6D2djxHRl+JOd22+IkmPawZ81MYNWdL5 83WXcoD1TtDnPuYUR5zaNCwJyNgIe1NVjH0+DtB+wayOys4s7LkE0H9Eqt8nWiU8Jq FI3hNf+u0v6QfVe4wcTOdillUllwelD6zntW8TmN+Q4UgwXThu1VImuZo1w0WJCOLR wtIZs9YyxyYTA== 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 46AB7C3DA49; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:03 +0200 Subject: [PATCH 17/22] iio: light: tcs3472: 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: <20240718-dev-iio-masklength-private2-v1-17-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=848; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=IBjfNo1AV7gv+op6SVY6NxHjmyuB/chdo1N1zk6XKlA=; b=qjuMCDKJWXx9En8/g3lMf9uVczVE+z+w4k8wrugTSpL8hBd3GuU4316lKJMBqDNz5nfCKGjC7 AtQTXgCza69D19og5UIt9mNcIZokc76dRaa+NFqwU9bod50fMjocKIj X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/light/tcs3472.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 89384dba83dd..04452b4664f3 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -383,8 +383,7 @@ static irqreturn_t tcs3472_trigger_handler(int irq, void *p) if (ret < 0) goto done; - for_each_set_bit(i, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, i) { ret = i2c_smbus_read_word_data(data->client, TCS3472_CDATA + 2*i); if (ret < 0) From patchwork Thu Jul 18 13:38:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736556 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 7AEFC14038F for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=me3+ZRNlB9w9x7a6yf56VuyLM3kGVu0Cof3tN1MZPuiQQXM7x3MlqVbSqEdGZFHoXiDfaL/9StTGKfbMQA0NlKeXhu0+IoPmM8Bp0vjsmQ7XfjYTUHaSDauwspRy2JvEeoA2BkDebWv0/2ZawNXm8iFFnejALKQyQRK0xUzkd1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=d8EF/kTrIVEsN3ovYThuD8DWN/GxMnbPQ2HCi1/OdAY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FNAIfT9NU9JfTmltJfjXPS2eytIAjCKiSADDqVwqurglVIeVZL+piS2eGDEKS8ZM405HXP8uNM1edVRuLpeHz38QDSC5YLKDBJzHB/gkrpSuHWWrylqPPwGZp1nimP4r0vm8VmjB3n+qH38E/XA4MmvseTtBVlt8674+9bq0o9c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r7e93tiP; 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="r7e93tiP" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5E68FC4AF17; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=d8EF/kTrIVEsN3ovYThuD8DWN/GxMnbPQ2HCi1/OdAY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=r7e93tiP7vwKe0P8OqWHz9LJtRWwDkDcpFFrscPUpCOcOTkUCUWuUbV19ryL+jbVr P3Ezy7FwHR27gBP0fEdKQdOztPsp7d+dmC+DIxOcyJSLxA5ZQyFENxOismSd5mGiX0 9o6yn8RguIhwx/xEgcvga3fOH/vpk6Tq3aQmh3ilavzIGipG6L+VZoUZi1R5YQ5JlK MLN8q0vbmozlWF0vSVkqdw9dgE8SIKcsMDeO+CRpcyu+45FFszYPJT1Q+iqoNw1T96 HZYSn/0dK1Sk00dPA47PrDcW9zYbnpE9hLmrIJvnJwuBjPRDMqofre/xDpiZd6SY6k IwnHUUIc6dEUg== 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 55727C3DA63; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:04 +0200 Subject: [PATCH 18/22] iio: magnetometer: rm3100-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: <20240718-dev-iio-masklength-private2-v1-18-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=963; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=frSUer5X5YE5lOu3IYnGGZx2ucpdgn6sI7LuCnpdktI=; b=xdOL+QwavzRfy2D5EBRZBhvnsu2mRXMY8ENP4T+7uGuWmJp+6F/vunrkUg2ztPxgk57BMQnam KvMDhgZR9ChAIDHSxRTeBFFXFrMp9KI6H1M9oATqvQ3f+HnCpTrQ4XP X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_get_masklength() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/magnetometer/rm3100-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c index 42b70cd42b393..0e03a772fa43d 100644 --- a/drivers/iio/magnetometer/rm3100-core.c +++ b/drivers/iio/magnetometer/rm3100-core.c @@ -464,7 +464,7 @@ static irqreturn_t rm3100_trigger_handler(int irq, void *p) struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; unsigned long scan_mask = *indio_dev->active_scan_mask; - unsigned int mask_len = indio_dev->masklength; + unsigned int mask_len = iio_get_masklength(indio_dev); struct rm3100_data *data = iio_priv(indio_dev); struct regmap *regmap = data->regmap; int ret, i, bit; From patchwork Thu Jul 18 13:38:05 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: 13736557 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 8B018140395 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=ExSqtCp1Sizzn7isM0HUqqSYrjUe1ZwD3XzHhHJU4WkTH4/XQlpyQ0NLTCZeUrmvLqP4sU5prLFg1qKbiQ9G67p0nRCg1Wzc2dSoW37HSMHkP2fhU2033VyUbhWO/QACoYRFF3nLX0GuLR4hT0vAb4olqLYNFDIT58lGiJht+ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=gknwNzQXz9IFiOrZZQSoM0t2YVp9ok1IqjrvHpGNUk4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MYzzzoEo/T2MpONRPXfMkmegBo4qePThKAXNAHp7+lEbL0IgiZgMsxvdb1pIS4oJyexaRYf/32vWGYCOIWLIjDbGRAPgCmwH3BxO7XkJiHfEb0xar+W7kewuVSI9pUgebyENJm/FjkwmCVYbRWGtsPWQ2CRvWCueLRM7blvsshA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AUYvxYnC; 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="AUYvxYnC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6E4C8C4DDE3; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=gknwNzQXz9IFiOrZZQSoM0t2YVp9ok1IqjrvHpGNUk4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AUYvxYnCCzLBe7P5KLv66HyGoMV2czxTmwrGcOJ79dzk4lUSSu+Aunm6Alfytkk45 5WNTztSEEeLGrDSCJU/5/3dn5qq2laEZt8ccbF24rjJn0FZT1i4KsQgjgFyPt8wfJW zBxbSRBf5kSdgJX1gsy+zhYKjUWPCUltN6Bw9nYH2ysv3VVwD7CuoMKjt8qZ0XWIB9 +86TWA5bVq8UGSIOuls/ctn0P/pcAVqvlTeLNU2bY3oq97NJbW5ovL+WdkECiMwEKd mW9Vt/g/V2aj03MzqjTGPMjZXqzkcpp6tFTXlfkbx8FnFlY+RbnVmIB8K+Ln2uHZ/M Jo63A4rGe7sUw== 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 65D2BC3DA70; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:05 +0200 Subject: [PATCH 19/22] iio: pressure: dlhl60d: 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: <20240718-dev-iio-masklength-private2-v1-19-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=875; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=uM2AzC1e0Tzt3pXETKVnH8wiQS6mvYBZvcnbeHKWkWI=; b=QHS62E8u6tC4ep8dGDfyuERVHUluovVF8UqRFV5C8RO8drGDug+4p4VkqasFbBFyViwWjmClR FSd5imZ87ObC6PPeoxOwJqQp+JIcoNHTHGMhIiCp3m1XIKvlVGjvYhq X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/pressure/dlhl60d.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/pressure/dlhl60d.c b/drivers/iio/pressure/dlhl60d.c index 0bba4c5a8d405..c1cea9d40424e 100644 --- a/drivers/iio/pressure/dlhl60d.c +++ b/drivers/iio/pressure/dlhl60d.c @@ -256,8 +256,7 @@ static irqreturn_t dlh_trigger_handler(int irq, void *private) if (ret) goto out; - for_each_set_bit(chn, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, chn) { memcpy(&tmp_buf[i++], &st->rx_buf[1] + chn * DLH_NUM_DATA_BYTES, DLH_NUM_DATA_BYTES); From patchwork Thu Jul 18 13:38:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736558 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 9EA3B140E4D for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=OwAurgNbbSqCwVcOo0oCIioqSgJoa+xRTxFav45gaK8S8lF47H2Cqr0yvR+SysDPW5Ws3uUanqfMBDZZQ/VJK32McwYdmB9mERgZODQ2VLeWUXs8qV+VzfTxm8MD8Jk2g6YHDmDSlFc7gWv4kDFjKbCz1iyO2eVG0cAA0sV3W24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=EZ9UZrCe/4YjLZnoVzNv/ARJNb+jViAGn8zxqAPbsuA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hotbMLzLOCtprIMZ7MfYMXyCkD3XlgxiFZELf6m/cZqi/9oUn4y7yB6xYMPGjjSrWgbSv7+nHvPLNeYIqiSQ2+L/qyI8FISh51VqCt+tjTNRj1/z4TXWSHdbbCBfJLj/ALMtl28Mj+lXnHbWIMtuWHs05ynzEO3JjONWvCShH2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jvxk4Nvj; 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="jvxk4Nvj" Received: by smtp.kernel.org (Postfix) with ESMTPS id 80D28C4DDE7; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=EZ9UZrCe/4YjLZnoVzNv/ARJNb+jViAGn8zxqAPbsuA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jvxk4NvjT69Nmuf1XFOanVrYxwjUmgLyNKCwNSITx/Hlha9s0M4cfKEgf7YUzPeI4 V1DW/+utwslhCHRPdd+fzzQ+toiXxtBz8oYmHt+oA+2sxqToQ0OOXnlEnHyYjcPqUD arvtIKVK36m0vCcvWnZfogGSwZczZRDXQYsZXnybDFqjx3X24yLp0+1ZJo+R/U2TP3 GLkpd6sc6RQ/WzPaJ414WkfPDyHDlTMHoloykuc09XPNAoa+lBqi6W93F8RwXlE/0M w+Th35VWz+eFAcNjdKoVMrLMXiKEpOMvxAYlpNyzJH3J28MN/lW4FEI5vHni6hBpbe Gx+/yXxwcUD8g== 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 773FEC3DA49; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:06 +0200 Subject: [PATCH 20/22] iio: proximity: hx9023s: 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: <20240718-dev-iio-masklength-private2-v1-20-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=1284; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=5J4ljVqvZC41+4k0k0jyV5NtbaiSrOltZERqD/amCmU=; b=z9I/xVnWw4qFt7RCBPr3WfSWATEcbv+auOnEzZcGbCIRTxpe155iqa46TsHlFgR+7T6QgZOKx X5Wj80h+geGCIpOzDaibaIzmQXzQyr3OKHvSoG2Jk25w3ZZ5h3u2crE X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/proximity/hx9023s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c index 63e3b56d4f4ce..fe14a62a13428 100644 --- a/drivers/iio/proximity/hx9023s.c +++ b/drivers/iio/proximity/hx9023s.c @@ -936,7 +936,7 @@ static irqreturn_t hx9023s_trigger_handler(int irq, void *private) goto out; } - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { index = indio_dev->channels[bit].channel; data->buffer.channels[i++] = cpu_to_le16(data->ch_data[index].diff); } @@ -957,7 +957,7 @@ static int hx9023s_buffer_preenable(struct iio_dev *indio_dev) unsigned int bit; guard(mutex)(&data->mutex); - for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) + iio_for_each_active_channel(indio_dev, bit) __set_bit(indio_dev->channels[bit].channel, &channels); hx9023s_update_chan_en(data, channels, data->chan_event); From patchwork Thu Jul 18 13:38:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736559 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 B01501411EE for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=RiDohNNR+M7cHXNUn+repBRFwc8sJuFP8KyxUMq2tBx5wuSw8CjfrYhyroI9Ow1DX9L84XUDVuYrfefDAkQ91GDyHOOreaGeQUghUrSz93bfW74rxmZInNjFLFJWFhdH0iBVXelQf5QWsFQszvyLVnNVyoSD9dWupU7eVXxq/Dk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=yZIam3yx92XZW+YQhILDtJcsiTNT5eUuTFoZVW0jIpc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HeIyDtyCAvzqePo/G3B1Vw4WehHQyD1Ka4jOQ8RPvmDkV7/zdO4Dd3BR5vaniq8XwJRm6wcJ4WCwyJTtRJbaj/qLl4wEW4/7KymYZ7m3Dm2veI+5Ui462Xi2WWr57NLC3uafut1uOeXSlv9AaOTlxWZoU1mIz+0uLbvWAgN7V7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MLqYeiuN; 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="MLqYeiuN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 940CEC4AF1B; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=yZIam3yx92XZW+YQhILDtJcsiTNT5eUuTFoZVW0jIpc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MLqYeiuNHZIchs/4UbD1JTFAw1dLaBvvwwZKIf925E+WTJh159DnXHa9Al6Nna1LE NTgi7WdQ1SiWqPLJ+dZgXFX/Iu/jjcPaxrobVBSUOaueutsT2cECrFTwl0qT490rO+ tmNbTo5zpo3QxEfnUYr2Daox0unpu0LMefNdDYtxhBIZuXNKlvxM/md9vhnyZ/XRxq ZVl/Bzha/2FA/3URILp9V5dBId4aCz8zs5bbrynbINJxA8Y6joOKOt7/QEvfQdKvF4 lOm/Qx4RnYhx9GVfXtJGVCEgRFI9O8lTJ7y+K/xihfEjWn+r8Zi6g1Y8Bu2dYtsWbt s3ldESATFoBVA== 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 8AA79C3DA6F; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:07 +0200 Subject: [PATCH 21/22] iio: proximity: sx9500: 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: <20240718-dev-iio-masklength-private2-v1-21-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=882; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ow/lbjAF7xbc1nHR62ZbO63cFYfGv+YoVHj29IIfWfw=; b=uOkhJEJu+o+1RnNZGbnQMQ23zi/TQX9k7PVWN3vAGC3MRgX2lRd3VaqrlxcuydrtyW4TbXhik m5HmY1HyyMTCozeP8a7ODeW6TpUENNfo5c1teG1w/gcJwfP3v32Km/j X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/proximity/sx9500.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 92630812ece2..3f4eace05cfc 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -654,8 +654,7 @@ static irqreturn_t sx9500_trigger_handler(int irq, void *private) 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 = sx9500_read_prox_data(data, &indio_dev->channels[bit], &val); if (ret < 0) From patchwork Thu Jul 18 13:38:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13736560 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 CCF9413FD86 for ; Thu, 18 Jul 2024 13:38:26 +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=1721309906; cv=none; b=VIgn3eFgNPcp+Dih/0zat/+yISK5PIeiB6jre+BQ/bBZ96lkt53EoN4GY86I7PPiE5leGfUwUhckY+LX62WqvlwJb+Sjfvv+ObWVgl13ywZGU1CV1fRTXAGDskjehNxUR0V69NFSuT5cr1pmfI0RstUN5bfHVcJfaYMRxuuFiuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721309906; c=relaxed/simple; bh=rv1eY9EO2BNh+lSmQQIl2m9zN5xt/7jDSp8YwaLtmO8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S9D6vKNLJmVfl/OMs/nQVGw4ovpSOB37gpgqRf0ldInCIpKpC+htBbJ5cs9/HUwedjEhm+5My29cMQFf0zdYlM/5z6rONgHkPM8aDAVmWdClOWVcaE7K3PIy0SwD5C+lvjBT0BJ1rfOpkSQUVoJZbE8HbL518H3OvOSeF7A7Exk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LH/fVjtk; 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="LH/fVjtk" Received: by smtp.kernel.org (Postfix) with ESMTPS id A4BA1C4AF0F; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721309906; bh=rv1eY9EO2BNh+lSmQQIl2m9zN5xt/7jDSp8YwaLtmO8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LH/fVjtkF8MyO9rawSIT0SlzfvoQfN9kf/9xoiwZfwOe709jRVkwFDsqacaJuPSGq grO4psZjKTP/ml885UTIlkk1iXLRAmF4GNk4F/5nIvsi6UiUMybLFwSWQGYxjXji6j YTDrIqIPFoHgMS3dsD3+jx0lHzc2gQSAyh1qzp9bn7jgXwGLXR9DhC5XWd92kvzWmr +YX5/DLww4pp3xOwjwjGOqVHJrO/K0Uq8UZL3whs8XtCXBjwCxdIL1ywcxGeWDhFfR 7F+mJsOhti2wa2OOsl8VkUzQpoSRf/JuMqA+3MB55D9hpCRbKtkDijHoqIDbFDms59 dmkqtJle6ZVbw== 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 9D776C3DA63; Thu, 18 Jul 2024 13:38:26 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 18 Jul 2024 15:38:08 +0200 Subject: [PATCH 22/22] iio: proximity: sx_common: 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: <20240718-dev-iio-masklength-private2-v1-22-8e12cd042906@analog.com> References: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> In-Reply-To: <20240718-dev-iio-masklength-private2-v1-0-8e12cd042906@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andreas Klinger , Song Qiang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721309903; l=1313; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=NYWZa2/XbLLl1ArjhpZ1nSWe6IAZWkml4RKT6VvzD7U=; b=u8mmgUBYXjarv3tjrit26WZcPRYGU2UZ90hedz8bkTFDWCWbVuWtwSe6OL5UGBmHoaNWXOZlu ndxSYU+hs/dBWluJWGbam9H65JvN7Esn9VWxSJr25rSI1IBqyfYN4u9 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa --- drivers/iio/proximity/sx_common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c index a95e9814aaf2..71aa6dced7d3 100644 --- a/drivers/iio/proximity/sx_common.c +++ b/drivers/iio/proximity/sx_common.c @@ -369,8 +369,7 @@ static irqreturn_t sx_common_trigger_handler(int irq, void *private) 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 = data->chip_info->ops.read_prox_data(data, &indio_dev->channels[bit], &val); @@ -398,8 +397,7 @@ static int sx_common_buffer_preenable(struct iio_dev *indio_dev) int bit, ret; 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) __set_bit(indio_dev->channels[bit].channel, &channels); ret = sx_common_update_chan_en(data, channels, data->chan_event);