From patchwork Wed Jun 12 14:20:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13695114 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 A501517E90F for ; Wed, 12 Jun 2024 14:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201853; cv=none; b=gfjPNNbflEiRpcyvz9dBTHgn5d3oqgLrcp5AAjay+DIQp4W4icHrDt9Od8BYCoRc8Xc8lyPxlhIQ3ekRiJJEx1C/yvAD4BI79RYqhbBKXEQCESHx4s9gE94czc49LDKWN+/JO6vINEBt0ZGjWXBzMw2d6AcO8KNqCyMOKPWEV5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201853; c=relaxed/simple; bh=1NlGtxxAHIubQEBvsF8E/0tuFfrqkT9ncbgbD8ji7lY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=FiA9gKwD+bNPh0XGG5IlSA76h0Hdx4PZ/YEaKfOP9RRa8lj3ugV/2AXdrL8XqSK8LTLJoecSz2+ITNTH0n2Nk88sAbhCp/vKYdgcn5dll1ZdgxLWYbS566yYr6l9dareuB+Nc9Kl+UvksehhRWM7Nvdm6XwLkL39g2wH6xHSFfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=dYjr1fmP; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="dYjr1fmP" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CC96t4001981; Wed, 12 Jun 2024 10:17:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=TJ9js 0XXbCIlby5p+oITpwdIysb4THYVK7yCy8et/Ww=; b=dYjr1fmPVvU272xdNwAD1 1rb1PHpNiy60WpHzPteJUzBgztgpIxIVOU0UmhiBuRsjlEB3aDai17S4PHyEv7Ub 3U4uZFnYDsXNSmIvEnHJSwK2dG918NLEuf2Rdf6iB7ZtmWVlHnTPcj5EJoXpEc6c Df7vJtUgDjXtm0JLaEpoj3d5XmAtw7Cx1xo5iSQB6j3KQyCkzZw0+T+t/WxF8UOX kNa8nnlKRHeXafBk6l4uGPBHbvYm6rkAEDNduMDhimGXeL5ojlZSCubTYkgLtdZ6 A0NdG3f2GJ7Zjdjc7/hBomaMRMMhK0hECAi1CxazTxUEklzHh3ti34WZUv1J0YKf g== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3ymm727k3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 10:17:17 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 45CEHGH5053073 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Jun 2024 10:17:16 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 12 Jun 2024 10:17:15 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 12 Jun 2024 10:17:15 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 12 Jun 2024 10:17:14 -0400 Received: from [127.0.0.1] ([10.44.3.54]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 45CEH4Av027005; Wed, 12 Jun 2024 10:17:09 -0400 From: Nuno Sa Date: Wed, 12 Jun 2024 16:20:48 +0200 Subject: [PATCH RFC 1/3] iio: core: add new helper to iterate active channels Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240612-dev-iio-scan-private-v1-1-7c75c8e3d30b@analog.com> References: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> In-Reply-To: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> To: CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718202053; l=1100; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=1NlGtxxAHIubQEBvsF8E/0tuFfrqkT9ncbgbD8ji7lY=; b=YDzUurcxPLO9Yb8dYh7XSaTRIru5e6zsLArUTEsyNr+beh1woYMaVMDSNL/W8lG8CSxAPQtbZ y5LklbPX21OAXZVEoHu1pOIrKo6gcQt84PxGg4VBFt0tMcVqfpq8Ome X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: NkEsMbUE9Rx6CZJs3ihKcnlnZTX0QlEp X-Proofpoint-GUID: NkEsMbUE9Rx6CZJs3ihKcnlnZTX0QlEp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_08,2024-06-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 mlxlogscore=968 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120101 Add a new iio_for_each_active_channel() helper to iterate over the active channels. Also add an helper to access masklength using ACCESS_PRIVATE(). End goal is to annotate that variable as __private so that we can get checker warnings if drivers directly access that variable. Signed-off-by: Nuno Sa --- include/linux/iio/iio.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 894309294182..a63888746707 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -860,6 +860,12 @@ ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals); int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, int *fract); +#define iio_dev_masklength(indio_dev) ACCESS_PRIVATE(indio_dev, masklength) + +#define iio_for_each_active_channel(indio_dev, bit) \ + for_each_set_bit((bit), (indio_dev)->active_scan_mask, \ + iio_dev_masklength(indio_dev)) + /** * IIO_DEGREE_TO_RAD() - Convert degree to rad * @deg: A value in degree From patchwork Wed Jun 12 14:20:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13695116 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 455FB17E915 for ; Wed, 12 Jun 2024 14:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201854; cv=none; b=WzL4s5B2bkMlhCdyyWCOIoLqLO3GGewFuNCShisZ5CWniMBe8UaVYv2AL5Y7O6cjmBfpim/BioIy03sFd59zEnAy2izICuDuznIIqBSvAigolx1eaToKKvSVx9waD8fBGScFTZNjscr0uIPHhqSYpu1jx2EhpS/93Cnz+NnnXx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201854; c=relaxed/simple; bh=3F6OnbBb0AIU0NcJf3ocuW0qrtTru+HnRObdH34cHE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=bcQxg28WJ3VGGfjVnD5LF9wYJXu9Jein1/EgoE7/xXryMEM+QNNE3/vCMj97CbOYQaNZNT4/dLwx5Pn8iaTYBOUk1XhkJccOXcr7oGSoQLcn4W77zlbcBz8PlqUzfaz6qeFzs8TJ2t95+LfNLRL6YJLWMp9B2syCLWWjE/jTFR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=fa/7c4+6; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="fa/7c4+6" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CB0hgF012438; Wed, 12 Jun 2024 10:17:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=5HKi8 nLro6cTmVwKLwDFViJTkuqueWrVIkQI6B0561E=; b=fa/7c4+66FFq521Nun/nN 0qLJV5ONtlTiRj1i+UXs2vlqonP5IHoetRJJLmy3Np6aQ3MrrEWVpGI6AEmeqOnG RBiE3jW3cgY34XG/LtDYXvUoByO+hqYv3udAOAk9BZ1kgoyeDbpwGkwBkavfaRnq yiTE7UOBUiutlboe2DOlyhW7LZQIgSJXu/CKaRw7F9S71LZKHEFkOFW/JLW9WUL7 CYUTpiFaPZGxwEvcvTiEY/MB4nKL/3JW0dBv0LFVwNvyl519gUyFKKx08N5gjEs1 6ftkqbI7TP7GdGp3Bhn6ch2skLPFIufGI2d8wN3t9RqG/ZIgcgJumgbfNldjF8+9 A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3yprwjv5y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 10:17:19 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 45CEHHGS054191 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Jun 2024 10:17:17 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 12 Jun 2024 10:17:16 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 12 Jun 2024 10:17:16 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 12 Jun 2024 10:17:16 -0400 Received: from [127.0.0.1] ([10.44.3.54]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 45CEH4Aw027005; Wed, 12 Jun 2024 10:17:10 -0400 From: Nuno Sa Date: Wed, 12 Jun 2024 16:20:49 +0200 Subject: [PATCH RFC 2/3] iio: imu: adis16475: make use of iio_for_each_active_channel() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240612-dev-iio-scan-private-v1-2-7c75c8e3d30b@analog.com> References: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> In-Reply-To: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> To: CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718202053; l=783; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=3F6OnbBb0AIU0NcJf3ocuW0qrtTru+HnRObdH34cHE8=; b=dzc3i4lMtv1X2oKZexGBNaT9vNW6SYwALsKzKJQ35kDtIJ3HBuPyMHPwmstDK69mSd1QDOxBi yuvftx6DoMZBkSPimqG2dcYYlZfffgmFhQMLdbZ+gknlYhNG7D8uCiq X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 0tH8Bsph-puLdxb6y8V2U4vFzaRVjNbM X-Proofpoint-ORIG-GUID: 0tH8Bsph-puLdxb6y8V2U4vFzaRVjNbM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_08,2024-06-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=715 malwarescore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120101 Use the new IIO accessor for iterating over the active channels. Signed-off-by: Nuno Sa --- drivers/iio/imu/adis16475.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index cf73c6f46c79..1cc2a66a78ff 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1608,8 +1608,7 @@ static int adis16475_push_single_sample(struct iio_poll_func *pf) return -EINVAL; } - for_each_set_bit(bit, indio_dev->active_scan_mask, - indio_dev->masklength) { + iio_for_each_active_channel(indio_dev, bit) { /* * When burst mode is used, system flags is the first data * channel in the sequence, but the scan index is 7. From patchwork Wed Jun 12 14:20:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13695117 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 8862117E90F for ; Wed, 12 Jun 2024 14:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201854; cv=none; b=mbfXnGO5cwLRVhTTiOjXhCb9hOPKU1ajKjvVdQFkVKL/0eyJrbnu7l1FWxUApYZ4z+0+YjgHjUZDJQEIontt5qCtnJYlku9GiVFPZOsQlQX/pp+HYtmvCD1LDBdYfvdNGlVPyjvS98pwOVNucnun5PGT1bYRaNnveFeB9oYx0e4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718201854; c=relaxed/simple; bh=+hnurly2JGZ4xZiCxoJh3Tw0X2UwbUQO1AFXBq7dhjU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=EgoQGjaT35sFX3z3D1jZlNgEGSUvzx3FwkVl8u9Av+BPBusZT30wvYCibf08Nkk4KumTs03h85sRRJfhwS/p+M+zUFzoPdTz1f/dpB95TGerxB4dvoYY8T2mTtk+o8MtFnCNNNy70d/yYUoCKWlmXu7MnWpGM7slCBxzuHT1/cQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=r17g6HNR; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="r17g6HNR" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CDndjt000785; Wed, 12 Jun 2024 10:17:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=lUJOp hAD/q+V4mYZ2i0hysTxrxO7UC2IMjuwj5s3WFI=; b=r17g6HNRPKtzQVrcwwgv9 obf05WqomBndZ9PMsP9Qdx4VDyPNotcNEhGdUiv88V2qP7Lxdn0tR23HxmzOZCq4 RIdexgSm4EggPT3G/emvGcuaRNqjEVRC9hPlxtSxkZ0JN/ALq96no8YruPheJG+6 hnoACg3iYsC2mFa1v7rNzR1Bzbj5RAMIZZVkpUt6+oFererIahfAK//nFq2TZADi q7SDceW0FC3DyP1UXEyZCgTWaA0yVjrfBaWtODk7CXqX6A5kExaYGcqGJfrfdXRT aTd1pMwS1k0VBDgurV2/9Jw3EVCw6j4Qb4esiPxFCpp866Zzaf8epGCfqjWKUHwz w== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3ymm727k47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 10:17:21 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 45CEHK1M053082 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Jun 2024 10:17:20 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 12 Jun 2024 10:17:19 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 12 Jun 2024 10:17:19 -0400 Received: from [127.0.0.1] ([10.44.3.54]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 45CEH4Ax027005; Wed, 12 Jun 2024 10:17:11 -0400 From: Nuno Sa Date: Wed, 12 Jun 2024 16:20:50 +0200 Subject: [PATCH RFC 3/3] iio: core annotate masklength as private Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240612-dev-iio-scan-private-v1-3-7c75c8e3d30b@analog.com> References: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> In-Reply-To: <20240612-dev-iio-scan-private-v1-0-7c75c8e3d30b@analog.com> To: CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718202053; l=702; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=+hnurly2JGZ4xZiCxoJh3Tw0X2UwbUQO1AFXBq7dhjU=; b=urzCe8U0EisuUmXkMMsJFqseo2Wrk169G/5NjWDVzvz9y52TRj3ag5hiMgc9BBqahgS/QHBzB wyKweIhXF/iDr6iDIDEz72JBWCQzQ/LjiI2vOywVifcL0sTGKV0ks6K X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: PGMIETpMUqeyKDJLsnzJZxSqMXKCJgVc X-Proofpoint-GUID: PGMIETpMUqeyKDJLsnzJZxSqMXKCJgVc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_08,2024-06-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 mlxlogscore=982 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120101 Annotate 'masklength' as private so that we can get checker warnings if drivers directly access that variable. Signed-off-by: Nuno Sa --- include/linux/iio/iio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index a63888746707..94677240df64 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -609,7 +609,7 @@ struct iio_dev { int scan_bytes; const unsigned long *available_scan_masks; - unsigned masklength; + unsigned __private masklength; const unsigned long *active_scan_mask; bool scan_timestamp; struct iio_trigger *trig;