From patchwork Tue Jul 2 16:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13720000 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F10E81BD4E2; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; cv=none; b=FcduxiFUDts6ZjtIQMTq4SN/0MZhD4HwAiLDyQKOOUzj/0LkFaRpwoqjpyB8OqaIY5iRA89RmbL7qZQ9OCqOvq2M4A2a7jwcwnD7xnSC7gT+RM+nKnFv+YqZj9ft6oovi1s6Erd+y+l/khjYtUrLODt/B6KmL7Px1zpTryoax6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719936160; c=relaxed/simple; bh=uO8h95Raq2yO1cXDpXi+1Lxc+3OeSQ09Wa5SZdi33oY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D3Cs12eveeo2FJeUtHd9+refqkvHYvHsCVIrSyeZo2WeZ1iNg0BpabpxiPvETxwbwGHQgRhR6c6E5DmtMPbUy6OOtq+QL3nt64iLqYOw1LwbXzZB2Ug/yycT0HZRT/wEhvjDNmaDiQB5+3XEwc8L7iOzJmH1n+XePJX648cuT2s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FHzyyNCH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FHzyyNCH" Received: by smtp.kernel.org (Postfix) with ESMTPS id A0B7EC4AF48; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719936159; bh=uO8h95Raq2yO1cXDpXi+1Lxc+3OeSQ09Wa5SZdi33oY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FHzyyNCHLBPRBrODchSbYz9J4OsDNnnhjiHTghKk5VyvmMTjJ5ywqMLa5g0uyCqrQ ipDEU9RkEXfKLqDBRD9jDCYKQVpAMHMUeF6vA2DbNpFtw14fH0V73NFh4F/0Db3Q7r xjamZAewyLP7mS1uqZKc1chUrblF+7Al941uB7Tnep5teG7zOc+V5u45Uk1wSsxrqw zaB0JRwTZwj6Ahlmj4Hxub3eAzCxKEXXPwudOPJ86PpoJnb/bT2GhmVQADpWsK28TN YbLMY2D3uNoYWHLJB9+629xNRMZaSM8HHV/eVJEKSHlci/e6AD2xjRLv5C+KjAnoPt V2T3nf2RsmpIw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99228C3065C; Tue, 2 Jul 2024 16:02:39 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Tue, 02 Jul 2024 18:02:43 +0200 Subject: [PATCH 11/20] iio: accel: sca3300: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240702-dev-iio-masklength-private-v1-11-98193bf536a6@analog.com> References: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> In-Reply-To: <20240702-dev-iio-masklength-private-v1-0-98193bf536a6@analog.com> To: linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Michael Hennerich , Benson Leung , Guenter Roeck , Dmitry Rokosov , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719936157; l=930; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=NiKRjo63/+CijDcg34TeX86O2hQZxnlYkTzG1tnolLM=; b=jPnvlGu2A4lqfgW/FRAGVpZf3vAhpuc2SU3/FBNHyOU5fX8sYsPlhAeFv8kmHbE6KA5zkQ2+E mO5j0bhHf2OBadPDqmAb8uiWfq07u9LfBK0TjgkXcnZpPv23KfZLwka X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa Reviewed-by: Alexandru Ardelean --- drivers/iio/accel/sca3300.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c index 306482b70fad..fca77d660625 100644 --- a/drivers/iio/accel/sca3300.c +++ b/drivers/iio/accel/sca3300.c @@ -494,8 +494,7 @@ static irqreturn_t sca3300_trigger_handler(int irq, void *p) int bit, ret, val, i = 0; s16 *channels = (s16 *)data->buffer; - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { ret = sca3300_read_reg(data, indio_dev->channels[bit].address, &val); if (ret) { dev_err_ratelimited(&data->spi->dev,