From nobody Fri Apr 17 01:46:32 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 EC83A379986 for ; Tue, 24 Feb 2026 10:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929832; cv=none; b=TaB4CU4IRlNzTVMTBgA4k2i62w0HAWTLkytLl+tW/s08/a8/QImhHaGYa3Ui2Mwvbaw2rzmHyr6bi6m5Pqft43sL1hbHnAqN5vIcIuWo0JCbmRrQZRYi20c0DhsEyQ8SEyTmG8gGBxHA/gXe8nCykMe+3vAG4Nt8EEREVTt8szA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929832; c=relaxed/simple; bh=rdvBOwT1w+fOKzKlMJ4qCaqyF5VXzQXu8RFGhV4wPWA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KYi/oN8WU1B5OZtk+jqufcvS/rxaDPzaajCSiaHV6FJvfTmVkvnXg7v4+60tnwujP73XK8FTAtJmmFqvLRqR/x6gl8iziEuJHc8ZkQ1tURvKtwsw3EvnRLIWlyF+vaQ/cvNO1Q5FpYwORaivuUZNuhWqJpJ6rWlHgDT2brDjfPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=H4DOzgVA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Dw+dG3XU; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="H4DOzgVA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Dw+dG3XU" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61OAFNqk057159 for ; Tue, 24 Feb 2026 10:43:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Dcx9Fb9RAhIPBMtW22u+1jg9hETgYE9w0yg+16sdIuA=; b=H4DOzgVA83UHDgOM VVUnvWAYTLNOLPanpo4QupRYaWBh1QxF944TCbYx88pbymRFzDVawGttNM0lIv1N OAIJordGF5UDSK/c+qa+HpzR/3laOnj+Vq8+dUUI6f0+VqjvNHoF9NNbgs6slhDn usF4sPZ2ZO1C8eEJPwL6rd9Nk0CNGDVcflRdQref2T9u/ORNXr2kIbOTL/WYf9zX 93cyZ8xqZ3nx25GYa0Kyx8g5utiIACl349wERwD/2WxWT4ConMD/lA+AwFBwhfss Z77+KjN/3XFhyxvVhpVf3xhAcQIDrzVrD8WMt0Bfl6Nz0Qc5Uu+NGFcxFtEbxr6A o6MMGg== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ch9sa84dt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 10:43:50 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8cb3fae6f60so6041977785a.1 for ; Tue, 24 Feb 2026 02:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771929829; x=1772534629; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Dcx9Fb9RAhIPBMtW22u+1jg9hETgYE9w0yg+16sdIuA=; b=Dw+dG3XUQUm/PHFpMKyHM8ZqNyUBhAV0OLKIOp3C1KQZgiCiMZm0nejujuse6sDy83 gg9GBBzlL1nO0vzkMsbjXpT7RcspqsQxIAhSvit6lpUJGv5gkelMcMntBJbm+qQr+UG+ 19w5dYgdkanqXnu63H0mw6k7NVFrl6XR4j5iID4RBoQbbRTOWEL6Zp+stEP8Dl+O569B RXcWYiD7a10yU+Zusc/ACVjeNSYcOx4qdXci0k7H24m9mhmje8gTE8baptXutAWZEU8a zrJYlPG+cNEt6nxY1QcGUC5RG4XvWg1OihVXLPmI6LyRw21fyoWqsritMl30UOM2Z2aT shzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771929829; x=1772534629; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Dcx9Fb9RAhIPBMtW22u+1jg9hETgYE9w0yg+16sdIuA=; b=WOMpb2jtDCwd/7HIYp1zV8Oge41ynYZygj3mMIb33tyhHeEBJFOTUNJpiuH1sz1rcJ wVJ6AYG9Rs16tpTFwNfPyxFJyEmf5CxHqbz5+kZ5/p6WYIrhcOgp9GtrtMfrpboMTowK AeXKM61r+gj6BFwuLV9B6CQzo0ZadsNr+i1409ggeVqSZR2zN/6I5X15Dc1xhiTQZUu8 z9dBo/5PRyicGXyxlfKmYnh9C3XuzyRAuOJ05I/BVMrXA4JmXNkB3Jte3m56MBg1UzU0 eH2g97Zl630CchORAMtPBnptHyw+m0L5Bbe7Ky8cm1Kv6t69qz0q3GyO/CTOa/Zx5nxV 60Lw== X-Forwarded-Encrypted: i=1; AJvYcCXXa6wqmgJvzD/7162LxHppigtNdKv4my3jY82NWDwWfJdq15hOxcwsLdKwhlyU3f/H1gbVk/yHV6f9jzk=@vger.kernel.org X-Gm-Message-State: AOJu0YzYIWOACqAqEV6MGlyEkyDOjUjz1Wz9Orqm8nCQN+BKzSHycX5O dxMtEDUqFA66MIM7xlVaOXA69tJ6CLR4DAlrNQHCd7fvlUpRXSGYasTXgRMFa7Lnt9BDC58bQtx Es1t67X9Kyxe1W9GKVJy8Hc2mGjNTSQpbgTiVJDPcKrZkNbbYiMPUnM7B5wa4oSMuI/1VlOzdzq A= X-Gm-Gg: AZuq6aJeboQSKPlILsk3+l3HdVpO35Xt27izPXf7gMnGoL4ecPCasmBnM01X7aVrPXo R8HXY3L3oEThJ7NsXs12DQlGJ3qhWj3+WlaKXdDBlXQnAORdMyr8ksTL/NxjHGYbW6OKSWSTi5i or7cXrZz/FFwIcsB8Zn6xot2yLus8L4knrDvUO1EQ5wlvIbrq+UTle82PcGZnOkFDZrDWVF3dbu uuJtfsRAE4oI6KN0Zp5xsvHW8XtxgatgYdSo9KEPKk7LN462wqXX3qVhjK8i4RGfiGXSXfLyrvW o8ClxCE0uGOv1WKAU6zUvxuHTk1on2SHkhplPl1FwMV9Gn4gMciwy9wbK83PoRXsVtiMhXCXSXQ TKfrXjS0Fblhkp2ovhzCmSAaBeF4FjNRixCnEd4rNzUEYLQ== X-Received: by 2002:a05:620a:1a20:b0:8c7:110e:9cd5 with SMTP id af79cd13be357-8cb7c02208cmr1910194285a.45.1771929828476; Tue, 24 Feb 2026 02:43:48 -0800 (PST) X-Received: by 2002:a05:620a:1a20:b0:8c7:110e:9cd5 with SMTP id af79cd13be357-8cb7c02208cmr1910190885a.45.1771929827852; Tue, 24 Feb 2026 02:43:47 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.140]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d40004sm25685906f8f.21.2026.02.24.02.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 02:43:47 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 24 Feb 2026 11:43:39 +0100 Subject: [PATCH 1/4] firmware: arm_scmi: Drop fake 'const' on scmi_handle Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-handle-not-const-v1-1-90bf93b53e27@oss.qualcomm.com> References: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> In-Reply-To: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> To: Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd , Peng Fan , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, stable@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=11852; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=rdvBOwT1w+fOKzKlMJ4qCaqyF5VXzQXu8RFGhV4wPWA=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpnYDdTaa70Ye5luvvU/8VfllC+pftv/qtWoBPV 3buBcqZcgeJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaZ2A3QAKCRDBN2bmhouD 1w8QD/9hJgj7Ium0TabC0RFOre/lPkhH80ZbNT0C7u3H72t80b9a9oXATiFxDqfMFn7onM2QmAQ M4iQ2VLzIT5u2i+dE85kbk7w7BD0HDHX8iTDl44DDfudhhOlhZIf+qq4A+cd+MRNHv7FoB4mSH8 TK1K6BTOytpaQM7P8BDz/qeN19Guercv31IYV/0yQVb++rV3G/CiRM1vVjiGs+MCN/9bPxteGyE q2vKegAYvp0KMqdMme8RCTB990GeOcrj1aaKnidRgBo7hiAgmWf1aTSU4gp4zKKYWH4rkM5+7/A GFECFw2Mfp4QPs993wWOYvruO0jWC21EdKKZ8hQDe8z7QAczC8IdyKIUsBYI88ocldlc1W5k8LN ItvOLcSqCrUmIgd7jzTEkUComIAui37o4BAndrsxHN+bRa2AcB9pd2Tu9/2VeUOII88WUFYMXDM D08TbnJtqxefQAH6hKwHG3Dt2RO/P9xlmJNL9qNv9/KIE0/XPzBIh+VHyQ7oix0ifPWH82/8N5R m6I+MXPgn/artpE+JEa/PQl8qaVMuywYXgLCvNg3OtNb0ABfYVXppKDZt8or7dPZb5MnBGlGWaQ Kfiv7JuRUsLv8gHLiLKG2JjlbrMTpWL677RuQ1Mvy9LGMr6CjJtSSCsFy8IuDsVTzc1+qrymRNx M4z9//C0G6j43wQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA4NyBTYWx0ZWRfX3TIzmYoX+b3G MYw+E8+wD45cSE9hLQNPoIsgbEVokfPCf2XhRAzi3dRpZAn1DrF2xLftZ0wu1CF4zxskjbmHUP0 mpll18UqqW5PZTUg0QsdKkZqmO8eAgcZUJfpxkhwKNUvIzvQU//i1XJ9HSpvYoSuXHav5WVoc58 DVOKILuUpYfDzrgqgrLUWG+OZ+FgwbSfAPa3NCYm0ls/q4UA+7UTel8zrvFyymLIYnAiI3LiPMT AixnlQ6F9hS5+8uR+spLkVtmV+B7yrI7HBiE4+LWC4C/U7/6b6UX5svDF1xlNZzn/q0MDbJdzfL IntNXtG3XGIPEPlrxnxMzOJKkwW3UvLi/PRjkmS7K5Bv/R0Ii0BeoPF7PkTfSELsB5q2ZaqodCJ bmiAZ00RtWq6qwnLwH0vUCYEI7LuLzGiphNqvd7hNJavZaR+Rxi9tVl9eqVpCn06puSgXLxCGye WQlmDBkxnMrvVmTeHCg== X-Proofpoint-ORIG-GUID: CPyTH0J-wk-lPapcgjqJec-khMcVvGT6 X-Authority-Analysis: v=2.4 cv=e7ELiKp/ c=1 sm=1 tr=0 ts=699d80e6 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=6nO30s3o7FuWeffXwhKHTA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=YWpryjrgZ2of67SKuAYA:9 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-GUID: CPyTH0J-wk-lPapcgjqJec-khMcVvGT6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_01,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240087 Severale functions operating on the 'handle' pointer, like scmi_handle_put() or scmi_xfer_raw_get(), are claiming it is a pointer to const thus they should not modify the handle. In fact that's a false statement, because first thing these functions do is drop the cast to const with container_of: struct scmi_info *info =3D handle_to_scmi_info(handle); And with such cast the handle is easily writable with simple: info->handle.dev =3D NULL; If the function really was not modifying the pointed handle, it would use the container_of_const() call. The code is not correct logically, either, because functions like scmi_notification_instance_data_set() are meant to modify the data behind the handle (in containing struct). The code does not have actual visible bug, but incorrect 'const' annotations could lead to incorrect compiler decisions. Fixes: 3095a3e25d8f ("firmware: arm_scmi: Add xfer helpers to provide raw a= ccess") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/clk/clk-scmi.c | 2 +- drivers/firmware/arm_scmi/common.h | 15 +++++++-------- drivers/firmware/arm_scmi/driver.c | 26 +++++++++++++------------- drivers/firmware/arm_scmi/notify.c | 2 +- drivers/firmware/arm_scmi/raw_mode.c | 4 ++-- drivers/firmware/arm_scmi/raw_mode.h | 2 +- include/linux/scmi_protocol.h | 2 +- 7 files changed, 26 insertions(+), 27 deletions(-) diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index 6b286ea6f121..f9efe14a95ab 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -405,7 +405,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev) struct clk_hw_onecell_data *clk_data; struct device *dev =3D &sdev->dev; struct device_node *np =3D dev->of_node; - const struct scmi_handle *handle =3D sdev->handle; + struct scmi_handle *handle =3D sdev->handle; struct scmi_protocol_handle *ph; const struct clk_ops *scmi_clk_ops_db[SCMI_MAX_CLK_OPS] =3D {}; struct scmi_clk *sclks; diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi= /common.h index 7c35c95fddba..a18babacebf2 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -154,8 +154,8 @@ struct scmi_device *scmi_device_create(struct device_no= de *np, const char *name); void scmi_device_destroy(struct device *parent, int protocol, const char *= name); =20 -int scmi_protocol_acquire(const struct scmi_handle *handle, u8 protocol_id= ); -void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_i= d); +int scmi_protocol_acquire(struct scmi_handle *handle, u8 protocol_id); +void scmi_protocol_release(struct scmi_handle *handle, u8 protocol_id); =20 /* SCMI Transport */ /** @@ -277,13 +277,12 @@ static inline bool is_polling_enabled(struct scmi_cha= n_info *cinfo, is_transport_polling_capable(desc); } =20 -void scmi_xfer_raw_put(const struct scmi_handle *handle, - struct scmi_xfer *xfer); -struct scmi_xfer *scmi_xfer_raw_get(const struct scmi_handle *handle); +void scmi_xfer_raw_put(struct scmi_handle *handle, struct scmi_xfer *xfer); +struct scmi_xfer *scmi_xfer_raw_get(struct scmi_handle *handle); struct scmi_chan_info * -scmi_xfer_raw_channel_get(const struct scmi_handle *handle, u8 protocol_id= ); +scmi_xfer_raw_channel_get(struct scmi_handle *handle, u8 protocol_id); =20 -int scmi_xfer_raw_inflight_register(const struct scmi_handle *handle, +int scmi_xfer_raw_inflight_register(struct scmi_handle *handle, struct scmi_xfer *xfer); =20 int scmi_xfer_raw_wait_for_message_response(struct scmi_chan_info *cinfo, @@ -522,7 +521,7 @@ static struct platform_driver __drv =3D { \ .probe =3D __tag##_probe, \ } =20 -void scmi_notification_instance_data_set(const struct scmi_handle *handle, +void scmi_notification_instance_data_set(struct scmi_handle *handle, void *priv); void *scmi_notification_instance_data_get(const struct scmi_handle *handle= ); int scmi_inflight_count(const struct scmi_handle *handle); diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi= /driver.c index 3e76a3204ba4..8b27e74d8a19 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -438,7 +438,7 @@ static void scmi_destroy_protocol_devices(struct scmi_i= nfo *info, mutex_unlock(&info->devreq_mtx); } =20 -void scmi_notification_instance_data_set(const struct scmi_handle *handle, +void scmi_notification_instance_data_set(struct scmi_handle *handle, void *priv) { struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -638,7 +638,7 @@ static int scmi_xfer_inflight_register(struct scmi_xfer= *xfer, * * Return: 0 on Success, error otherwise */ -int scmi_xfer_raw_inflight_register(const struct scmi_handle *handle, +int scmi_xfer_raw_inflight_register(struct scmi_handle *handle, struct scmi_xfer *xfer) { struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -730,7 +730,7 @@ static struct scmi_xfer *scmi_xfer_get(const struct scm= i_handle *handle, * * Return: A valid xfer on Success, or an error-pointer otherwise */ -struct scmi_xfer *scmi_xfer_raw_get(const struct scmi_handle *handle) +struct scmi_xfer *scmi_xfer_raw_get(struct scmi_handle *handle) { struct scmi_xfer *xfer; struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -757,7 +757,7 @@ struct scmi_xfer *scmi_xfer_raw_get(const struct scmi_h= andle *handle) * Return: A reference to the channel to use, or an ERR_PTR */ struct scmi_chan_info * -scmi_xfer_raw_channel_get(const struct scmi_handle *handle, u8 protocol_id) +scmi_xfer_raw_channel_get(struct scmi_handle *handle, u8 protocol_id) { struct scmi_chan_info *cinfo; struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -820,7 +820,7 @@ __scmi_xfer_put(struct scmi_xfers_info *minfo, struct s= cmi_xfer *xfer) * Note that as with other xfer_put() handlers the xfer is really effectiv= ely * released only if there are no more users on the system. */ -void scmi_xfer_raw_put(const struct scmi_handle *handle, struct scmi_xfer = *xfer) +void scmi_xfer_raw_put(struct scmi_handle *handle, struct scmi_xfer *xfer) { struct scmi_info *info =3D handle_to_scmi_info(handle); =20 @@ -2202,7 +2202,7 @@ scmi_alloc_init_protocol_instance(struct scmi_info *i= nfo, int ret =3D -ENOMEM; void *gid; struct scmi_protocol_instance *pi; - const struct scmi_handle *handle =3D &info->handle; + struct scmi_handle *handle =3D &info->handle; =20 /* Protocol specific devres group */ gid =3D devres_open_group(handle->dev, NULL, GFP_KERNEL); @@ -2282,7 +2282,7 @@ scmi_alloc_init_protocol_instance(struct scmi_info *i= nfo, * NOT be found. */ static struct scmi_protocol_instance * __must_check -scmi_get_protocol_instance(const struct scmi_handle *handle, u8 protocol_i= d) +scmi_get_protocol_instance(struct scmi_handle *handle, u8 protocol_id) { struct scmi_protocol_instance *pi; struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -2317,7 +2317,7 @@ scmi_get_protocol_instance(const struct scmi_handle *= handle, u8 protocol_id) * * Return: 0 if protocol was acquired successfully. */ -int scmi_protocol_acquire(const struct scmi_handle *handle, u8 protocol_id) +int scmi_protocol_acquire(struct scmi_handle *handle, u8 protocol_id) { return PTR_ERR_OR_ZERO(scmi_get_protocol_instance(handle, protocol_id)); } @@ -2330,7 +2330,7 @@ int scmi_protocol_acquire(const struct scmi_handle *h= andle, u8 protocol_id) * Remove one user for the specified protocol and triggers de-initializati= on * and resources de-allocation once the last user has gone. */ -void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_i= d) +void scmi_protocol_release(struct scmi_handle *handle, u8 protocol_id) { struct scmi_info *info =3D handle_to_scmi_info(handle); struct scmi_protocol_instance *pi; @@ -2372,7 +2372,7 @@ void scmi_setup_protocol_implemented(const struct scm= i_protocol_handle *ph, } =20 static bool -scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id) +scmi_is_protocol_implemented(struct scmi_handle *handle, u8 prot_id) { int i; struct scmi_info *info =3D handle_to_scmi_info(handle); @@ -2388,7 +2388,7 @@ scmi_is_protocol_implemented(const struct scmi_handle= *handle, u8 prot_id) } =20 struct scmi_protocol_devres { - const struct scmi_handle *handle; + struct scmi_handle *handle; u8 protocol_id; }; =20 @@ -2525,7 +2525,7 @@ static void scmi_devm_protocol_put(struct scmi_device= *sdev, u8 protocol_id) * * Return: True if transport is configured as atomic */ -static bool scmi_is_transport_atomic(const struct scmi_handle *handle, +static bool scmi_is_transport_atomic(struct scmi_handle *handle, unsigned int *atomic_threshold) { bool ret; @@ -2582,7 +2582,7 @@ static struct scmi_handle *scmi_handle_get(struct dev= ice *dev) * Return: 0 is successfully released * if null was passed, it returns -EINVAL; */ -static int scmi_handle_put(const struct scmi_handle *handle) +static int scmi_handle_put(struct scmi_handle *handle) { struct scmi_info *info; =20 diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi= /notify.c index dee9f238f6fd..bfc1d57ce052 100644 --- a/drivers/firmware/arm_scmi/notify.c +++ b/drivers/firmware/arm_scmi/notify.c @@ -1464,7 +1464,7 @@ static int scmi_notifier_unregister(const struct scmi= _handle *handle, } =20 struct scmi_notifier_devres { - const struct scmi_handle *handle; + struct scmi_handle *handle; u8 proto_id; u8 evt_id; u32 __src_id; diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_sc= mi/raw_mode.c index 73db5492ab44..efae99febdde 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -172,7 +172,7 @@ struct scmi_raw_queue { */ struct scmi_raw_mode_info { unsigned int id; - const struct scmi_handle *handle; + struct scmi_handle *handle; const struct scmi_desc *desc; int tx_max_msg; struct scmi_raw_queue *q[SCMI_RAW_MAX_QUEUE]; @@ -1210,7 +1210,7 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_i= nfo *raw, * * Return: An opaque handle to the Raw instance on Success, an ERR_PTR oth= erwise */ -void *scmi_raw_mode_init(const struct scmi_handle *handle, +void *scmi_raw_mode_init(struct scmi_handle *handle, struct dentry *top_dentry, int instance_id, u8 *channels, int num_chans, const struct scmi_desc *desc, int tx_max_msg) diff --git a/drivers/firmware/arm_scmi/raw_mode.h b/drivers/firmware/arm_sc= mi/raw_mode.h index 8af756a83fd1..49895b81bc3b 100644 --- a/drivers/firmware/arm_scmi/raw_mode.h +++ b/drivers/firmware/arm_scmi/raw_mode.h @@ -17,7 +17,7 @@ enum { SCMI_RAW_MAX_QUEUE }; =20 -void *scmi_raw_mode_init(const struct scmi_handle *handle, +void *scmi_raw_mode_init(struct scmi_handle *handle, struct dentry *top_dentry, int instance_id, u8 *channels, int num_chans, const struct scmi_desc *desc, int tx_max_msg); diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index aafaac1496b0..17095e41f5c6 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -909,7 +909,7 @@ struct scmi_handle { (*devm_protocol_get)(struct scmi_device *sdev, u8 proto, struct scmi_protocol_handle **ph); void (*devm_protocol_put)(struct scmi_device *sdev, u8 proto); - bool (*is_transport_atomic)(const struct scmi_handle *handle, + bool (*is_transport_atomic)(struct scmi_handle *handle, unsigned int *atomic_threshold); =20 const struct scmi_notify_ops *notify_ops; --=20 2.51.0 From nobody Fri Apr 17 01:46:32 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 B1EC7379989 for ; Tue, 24 Feb 2026 10:43:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929834; cv=none; b=Y32Sz+zK1ZVv3bVEgwuFxqwjEtfmBgOloB12bo14xLHLUFayQ11tywtwCWLev1WJkGCOcBwhw7ZffyY03thKHsEieUsSWtpT1EySjCXhTJZ5GY+NnOmj2j3gg9JEfB/O0d8iykB5vCVEXAtxvD8JPO3d6synBXNPkeRAJihy3nM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929834; c=relaxed/simple; bh=MtfFLt1YenfsJ/wZknYcaqCTSZ5/bjAtaD9/JYLsnnQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NYfDhPltbI1AqHELlIj6Gy6afXHU4VWWwrAuqd1+m5QaCCDpVOnXWj2skw2Tv+luF/7fR4sJxms5y/P5SK+HPEjuyoinHqTMJ9zyUotc0ne95WFBDZu8jLsBdB5J0wAul5O9CmBcZL8OPY4LHdbj5B+87lsxcMvsvKUgjnkVvqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=cPaYdboO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=khh1HqRR; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="cPaYdboO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="khh1HqRR" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61OAFdlg2285283 for ; Tue, 24 Feb 2026 10:43:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= EN2/oaoWAN9Y1ndJ/NXYNONg9LQ3Nd3Tzaq4ZTvo8i0=; b=cPaYdboOJOtS7ulU F+gmThGKKzIQQpHO32G4tCZofOrtl9Mi2ccHv8fQvLAU/099SCESdOMAFH0fwKej zJl2i4yGVsFdd5z19P92egoMpiiwNytSOy0YhTEmQxRT+AUAzmLcHvtT+i65X3OH cdaxxg4u5xDucaSg5G3VNLGRkEos6yVnDW9tiSw72U4+kS3H4s0bCoXRWBOsfjf6 1Eio3U5VXiHlqR7tQA3td0DkGrHFfz3To2anQ0yZjclAcPR5d9UCC+EVBe8vZBTu dDc85W3rc30lHjSFhzCHfMq6PdQllFDq8A1k8beM0Cz0ap/5hP5YA9uINV2bfkgF UVbMGg== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgtx0ascx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 10:43:51 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb52a9c0eeso630940085a.2 for ; Tue, 24 Feb 2026 02:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771929830; x=1772534630; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EN2/oaoWAN9Y1ndJ/NXYNONg9LQ3Nd3Tzaq4ZTvo8i0=; b=khh1HqRRAvX6WGjEQQyoCkGOYmnwI7FfZhHZsp7xvMvulcoyrnLGIWCLWzedU5YJqA KIy1YKafut3Z54KcOcrJ7lE3FX/o0giIpKlwIssovLLMqq1oPnr4nqk7vafVU5fiGJa1 PyCr73KwX4d4wnMzetZ3VoDzXAimWrW5sQ6ITGASFCfCm4apzeqM7zzPHzCqT5rs/3xl GID9qy8e91X4jFUskxFvHm3Ohw10PTjtajJgWyhAATjQeSfta7+ehpNV9TiyL8CU59a4 CJSPoIOAaP/60EMsR9cYwFEH6KwwZLO0FLrNy3O2Z7Rle26FXVoq/6ASam7k9ZiS5/eP 8r9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771929830; x=1772534630; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EN2/oaoWAN9Y1ndJ/NXYNONg9LQ3Nd3Tzaq4ZTvo8i0=; b=oLzdXninCilydYcJ9vz3PD8Bix8omGmYR7ee+2Yq4xPzre+kPrxBMdrwHFuD7ZpuMx 5BxolRoRJaiLaRqd0IC8gE3/45qczCkdC4iXs3otTlPF3iUnXIKnvyN8sWVkMiJMkMYd RzCPUu6pgmEhTXOCECFJ/OzRiwaW23lC2EbIgAYG0phFe87jyFlHzPQZQ4GuwvDeftwA cAmwQb6jRRii+3XvTCNjL4VKwqa1XFkjXmsRJoja/t6Y+exeJKVCCRLys3KanKYH8fHZ PWlNikagJqjLL75RqMIiAuZqAxTKIw7FehqGwwbE5PKMgG9O5JbADLZdB385uHOISXb7 SQ+w== X-Forwarded-Encrypted: i=1; AJvYcCV9nFHzwZ31K42bbV+NrkoDNHyyDcmuwrDod/nDyLqB2eQzvHVfvfTOeAUYm/gCjt+7F68y/DdWpHOobaM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyn75dYIBKFKtjMUxFqG91a7581nNT97FFHqnZtMmeP08Q+U3JI K+kLV9+a57eJ4rByYzWOZwMgtNNsZwN3Hrh1GtREprvVxWFdym63gMG8Wq5dYJZyhS3sGePuSES W7y6cpS9BgTS7vt3onDcsECGkddDZwYzOzDeC++JAx0rrxhh1WPqyd2eUPKFIenh1rwAE3aWVxB A= X-Gm-Gg: AZuq6aJz+eicQGgT0CsylWXTMPgBeXOuZqa/zinQW9F2wfd/rl2Knjd4IswfeH+7Euo xxbRteHRusj+tsceeMlprMFv5+8KOuHNKJS98PBczGaEKV/p2yX118Kpqrj52IcKxfDZ86Kk+nY 8s4gMRZ/nUwsoDR8JXQMeXNZjKeIyUNnzhorekPI99XE71op5HGuYKRwhn/tdM17NHTJn3wijos I/zKNYlLuh1Wbr0vu/lcnziPC1LZqaOMF25PjB40l6BfnOG6pe5hNrYcrdvjQbvXa14S6+g0hxn C9tZ7QKxjjxQoL9WPoktp1S+JS3jp1FkXspb9v7ZiZOyOhU9TWfs22F979Ie/JMKkQjeaSXZoSq pDjIL1CVb3xqYfO5ZnEOo//9b2EQpz9zrTSIlN4wqXKeQ1g== X-Received: by 2002:a05:620a:1904:b0:8b6:1877:3689 with SMTP id af79cd13be357-8cb8ca14a2amr1432281885a.35.1771929830437; Tue, 24 Feb 2026 02:43:50 -0800 (PST) X-Received: by 2002:a05:620a:1904:b0:8b6:1877:3689 with SMTP id af79cd13be357-8cb8ca14a2amr1432278985a.35.1771929829895; Tue, 24 Feb 2026 02:43:49 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.140]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d40004sm25685906f8f.21.2026.02.24.02.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 02:43:48 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 24 Feb 2026 11:43:40 +0100 Subject: [PATCH 2/4] firmware: arm_scmi: Drop fake 'const' on scmi_protocol_handle Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-handle-not-const-v1-2-90bf93b53e27@oss.qualcomm.com> References: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> In-Reply-To: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> To: Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd , Peng Fan , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, stable@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=11774; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=MtfFLt1YenfsJ/wZknYcaqCTSZ5/bjAtaD9/JYLsnnQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpnYDenvwWp+Df+vhEBzfsFyDfJYzjKv/jlKST0 85yGntKMS2JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaZ2A3gAKCRDBN2bmhouD 173fD/9N+O5OTQ5QmfRdqz4D8cWMNwN9LGcibNK0uSezOak//l35xH2ZllrAQyk+rUU2Ewv5+US r9O02OyXEQhwZwffW1KGyRq/4JNwVBEPwoZrZ1HacFOiZuvrmIGa4nh4GpRu0eWMLD3giALvetR yweybtVUR/g9ghF3ZueROwSANuwdXseWdJFrzFK1nbVe5+pgBxS5nSF3q+kZn5yFlZUHoxbG4aj wOG7mGHSgM5RH54+SITR3DaeN+3b9aQPl9yUUyZUHNmUaXiN6RaN3ERcnYli3rOJBNj6aDdBrPj Vfpz2Ap5Hq47Q7kOQ27q6aXQk6fX4LQ+ItKiF8mPCHgt6htCiPRm36/k3AN8+hgbX4JVvwWyAbp sOuMcleIy+/OtH6CxTmsnRXCniOuXof2YZybukRFER8fjoh7J9Ej2SlpOZkHK9OWgGfC7GS4nrQ z8UinGGV5GDZZtAr37unCsWVhqh6EyhsyjYi+MdIHBwAkUE+pXPbvgON25368JXxtPQQ81jg1If wUdByQT0kNOLAJHelHoXC4GJTSYco88WUFKlPAn1eUE7rr0TJOdCph4OReDaDOSga856jDVTLeE Bt0GCCTu28sMiLuwwKCoqj3NiEBeRSX3mcsMwIPJfBxtPgDS/izQuTZ8GcWChKl8FBI/R9drC8j TUEjhd4poi1gumQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: hECux8ZLSADReDUwiMFM38U_PXiMqLnj X-Authority-Analysis: v=2.4 cv=euvSD4pX c=1 sm=1 tr=0 ts=699d80e7 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=6nO30s3o7FuWeffXwhKHTA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=QOiUi5lJWKzMiGfd4uMA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: hECux8ZLSADReDUwiMFM38U_PXiMqLnj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA4NyBTYWx0ZWRfX2qtm8FCvodiO v8BHFPTGzagdOhihsoD2a8+XzOL+XfBnKkTdLcbpm4dAj9+ozPLbP17UAt/gzYeckOVDi3LwSMB EOuu64d60bUMDeb2S//PErnYwxxK7yTA+3SGyNiaKmBi7jCkT1+fIF8kJogFAbCihxYFQ7IHbzS DT2DgyI06I7CcRoa0qxZsQn9zTgNpi3044wnczH/VcY22aNjZhnOlse/dp+q06F3CXs/T8240Wa USDVUnHFWANdPkkciTMasAUDB18rbg9qeFY9PgpXvZL3syAgGdIKkI26CT4Q2Hq/rEgMfWLQd3n J8d+A6ezqJeqHgHeZO3QNBWZxPNhXcEWFqZN8TvMboF6OplR4FZ/c/cF9HMA5rPcpQSZMnHhEdc EeJvs5U3gBogwlbdhJYNNpbli4dsBqpcnSYGQBNz+ySnlSlQXKbyqRTxNSp1jRuwUBiJbTi8VAf YxLqkeGuhw8LAMwE07g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_01,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 bulkscore=0 impostorscore=0 phishscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240087 Severale functions operating on the 'handle' pointer, like scmi_set_protocol_priv(), are claiming it is a pointer to const thus they should not modify the handle. In fact that's a false statement, because first thing these functions do is drop the cast to const with container_of: struct scmi_protocol_instance *pi =3D ph_to_pi(ph); And with such cast the handle is easily writable with simple: pi->ph.dev =3D NULL; If the function really was not modifying the pointed handle, it would use the container_of_const() call. The code is not correct logically, either, because functions like scmi_set_protocol_priv() are meant to modify the data behind the handle (in containing struct). The code does not have actual visible bug, but incorrect 'const' annotations could lead to incorrect compiler decisions. Fixes: d7b6cc563a60 ("firmware: arm_scmi: Introduce protocol handle definit= ions") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/firmware/arm_scmi/base.c | 2 +- drivers/firmware/arm_scmi/clock.c | 2 +- drivers/firmware/arm_scmi/driver.c | 2 +- drivers/firmware/arm_scmi/perf.c | 2 +- drivers/firmware/arm_scmi/pinctrl.c | 4 ++-- drivers/firmware/arm_scmi/power.c | 2 +- drivers/firmware/arm_scmi/powercap.c | 2 +- drivers/firmware/arm_scmi/protocols.h | 4 ++-- drivers/firmware/arm_scmi/reset.c | 2 +- drivers/firmware/arm_scmi/sensors.c | 2 +- drivers/firmware/arm_scmi/system.c | 2 +- drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c | 2 +- drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c | 2 +- drivers/firmware/arm_scmi/vendors/imx/imx-sm-lmm.c | 2 +- drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 2 +- drivers/firmware/arm_scmi/voltage.c | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/b= ase.c index 22267bbd0f4d..8302aaacdf43 100644 --- a/drivers/firmware/arm_scmi/base.c +++ b/drivers/firmware/arm_scmi/base.c @@ -371,7 +371,7 @@ static const struct scmi_protocol_events base_protocol_= events =3D { .num_sources =3D SCMI_BASE_NUM_SOURCES, }; =20 -static int scmi_base_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_base_protocol_init(struct scmi_protocol_handle *ph) { int id, ret; u8 *prot_imp; diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/= clock.c index ab36871650a1..58cc392c1c80 100644 --- a/drivers/firmware/arm_scmi/clock.c +++ b/drivers/firmware/arm_scmi/clock.c @@ -1064,7 +1064,7 @@ static const struct scmi_protocol_events clk_protocol= _events =3D { .num_events =3D ARRAY_SIZE(clk_events), }; =20 -static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_clock_protocol_init(struct scmi_protocol_handle *ph) { int clkid, ret; struct clock_info *cinfo; diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi= /driver.c index 8b27e74d8a19..951711aa7d33 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -1630,7 +1630,7 @@ static int version_get(const struct scmi_protocol_han= dle *ph, u32 *version) * * Return: 0 on Success */ -static int scmi_set_protocol_priv(const struct scmi_protocol_handle *ph, +static int scmi_set_protocol_priv(struct scmi_protocol_handle *ph, void *priv) { struct scmi_protocol_instance *pi =3D ph_to_pi(ph); diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/p= erf.c index 4583d02bee1c..1c0a150612a8 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -1266,7 +1266,7 @@ static const struct scmi_protocol_events perf_protoco= l_events =3D { .num_events =3D ARRAY_SIZE(perf_events), }; =20 -static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_perf_protocol_init(struct scmi_protocol_handle *ph) { int domain, ret; struct scmi_perf_info *pinfo; diff --git a/drivers/firmware/arm_scmi/pinctrl.c b/drivers/firmware/arm_scm= i/pinctrl.c index a020e23d7c49..99f98eb6808d 100644 --- a/drivers/firmware/arm_scmi/pinctrl.c +++ b/drivers/firmware/arm_scmi/pinctrl.c @@ -827,7 +827,7 @@ static const struct scmi_pinctrl_proto_ops pinctrl_prot= o_ops =3D { .pin_free =3D scmi_pinctrl_pin_free, }; =20 -static int scmi_pinctrl_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_pinctrl_protocol_init(struct scmi_protocol_handle *ph) { int ret; struct scmi_pinctrl_info *pinfo; @@ -861,7 +861,7 @@ static int scmi_pinctrl_protocol_init(const struct scmi= _protocol_handle *ph) return ph->set_priv(ph, pinfo); } =20 -static int scmi_pinctrl_protocol_deinit(const struct scmi_protocol_handle = *ph) +static int scmi_pinctrl_protocol_deinit(struct scmi_protocol_handle *ph) { int i; struct scmi_pinctrl_info *pi =3D ph->get_priv(ph); diff --git a/drivers/firmware/arm_scmi/power.c b/drivers/firmware/arm_scmi/= power.c index bb5062ab8280..00a9f53295f6 100644 --- a/drivers/firmware/arm_scmi/power.c +++ b/drivers/firmware/arm_scmi/power.c @@ -319,7 +319,7 @@ static const struct scmi_protocol_events power_protocol= _events =3D { .num_events =3D ARRAY_SIZE(power_events), }; =20 -static int scmi_power_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_power_protocol_init(struct scmi_protocol_handle *ph) { int domain, ret; struct scmi_power_info *pinfo; diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_sc= mi/powercap.c index ab9733f4458b..ac527f59bc1e 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -957,7 +957,7 @@ static const struct scmi_protocol_events powercap_proto= col_events =3D { }; =20 static int -scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph) +scmi_powercap_protocol_init(struct scmi_protocol_handle *ph) { int domain, ret; struct powercap_info *pinfo; diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_s= cmi/protocols.h index 4c75970326e6..309e834e5392 100644 --- a/drivers/firmware/arm_scmi/protocols.h +++ b/drivers/firmware/arm_scmi/protocols.h @@ -183,7 +183,7 @@ struct scmi_protocol_handle { unsigned int version; const struct scmi_xfer_ops *xops; const struct scmi_proto_helpers_ops *hops; - int (*set_priv)(const struct scmi_protocol_handle *ph, void *priv); + int (*set_priv)(struct scmi_protocol_handle *ph, void *priv); void *(*get_priv)(const struct scmi_protocol_handle *ph); }; =20 @@ -315,7 +315,7 @@ struct scmi_xfer_ops { struct scmi_xfer *xfer); }; =20 -typedef int (*scmi_prot_init_ph_fn_t)(const struct scmi_protocol_handle *); +typedef int (*scmi_prot_init_ph_fn_t)(struct scmi_protocol_handle *); =20 /** * struct scmi_protocol - Protocol descriptor diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/= reset.c index 4bc5c24c2d72..532ebac3286a 100644 --- a/drivers/firmware/arm_scmi/reset.c +++ b/drivers/firmware/arm_scmi/reset.c @@ -351,7 +351,7 @@ static const struct scmi_protocol_events reset_protocol= _events =3D { .num_events =3D ARRAY_SIZE(reset_events), }; =20 -static int scmi_reset_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_reset_protocol_init(struct scmi_protocol_handle *ph) { int domain, ret; struct scmi_reset_info *pinfo; diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scm= i/sensors.c index 882d55f987d2..0a2b3bb83cc9 100644 --- a/drivers/firmware/arm_scmi/sensors.c +++ b/drivers/firmware/arm_scmi/sensors.c @@ -1144,7 +1144,7 @@ static const struct scmi_protocol_events sensor_proto= col_events =3D { .num_events =3D ARRAY_SIZE(sensor_events), }; =20 -static int scmi_sensors_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_sensors_protocol_init(struct scmi_protocol_handle *ph) { int ret; struct sensors_info *sinfo; diff --git a/drivers/firmware/arm_scmi/system.c b/drivers/firmware/arm_scmi= /system.c index 0f51c36f6a9d..dfb7183d1f14 100644 --- a/drivers/firmware/arm_scmi/system.c +++ b/drivers/firmware/arm_scmi/system.c @@ -138,7 +138,7 @@ static const struct scmi_protocol_events system_protoco= l_events =3D { .num_sources =3D SCMI_SYSTEM_NUM_SOURCES, }; =20 -static int scmi_system_protocol_init(const struct scmi_protocol_handle *ph) +static int scmi_system_protocol_init(struct scmi_protocol_handle *ph) { struct scmi_system_info *pinfo; =20 diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c b/drivers/f= irmware/arm_scmi/vendors/imx/imx-sm-bbm.c index 33f9ebf6092b..1f569951bb31 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c @@ -342,7 +342,7 @@ static const struct scmi_imx_bbm_proto_ops scmi_imx_bbm= _proto_ops =3D { .button_get =3D scmi_imx_bbm_button_get, }; =20 -static int scmi_imx_bbm_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_imx_bbm_protocol_init(struct scmi_protocol_handle *ph) { int ret; struct scmi_imx_bbm_info *binfo; diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c b/drivers/f= irmware/arm_scmi/vendors/imx/imx-sm-cpu.c index 753274af11d2..928d93a8603f 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c @@ -230,7 +230,7 @@ static int scmi_imx_cpu_attributes_get(const struct scm= i_protocol_handle *ph, return ret; } =20 -static int scmi_imx_cpu_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_imx_cpu_protocol_init(struct scmi_protocol_handle *ph) { struct scmi_imx_cpu_info *info; int ret, i; diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-lmm.c b/drivers/f= irmware/arm_scmi/vendors/imx/imx-sm-lmm.c index c56ae247774d..0a9af7ed1981 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-lmm.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-lmm.c @@ -223,7 +223,7 @@ static int scmi_imx_lmm_protocol_attributes_get(const s= truct scmi_protocol_handl return ret; } =20 -static int scmi_imx_lmm_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_imx_lmm_protocol_init(struct scmi_protocol_handle *ph) { struct scmi_imx_lmm_priv *info; int ret; diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/= firmware/arm_scmi/vendors/imx/imx-sm-misc.c index 0ada753367ef..79c7966888be 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c @@ -459,7 +459,7 @@ static const struct scmi_imx_misc_proto_ops scmi_imx_mi= sc_proto_ops =3D { .misc_syslog =3D scmi_imx_misc_syslog_get, }; =20 -static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *= ph) +static int scmi_imx_misc_protocol_init(struct scmi_protocol_handle *ph) { struct scmi_imx_misc_info *minfo; int ret; diff --git a/drivers/firmware/arm_scmi/voltage.c b/drivers/firmware/arm_scm= i/voltage.c index b9391c1ee8a0..60c3405b4999 100644 --- a/drivers/firmware/arm_scmi/voltage.c +++ b/drivers/firmware/arm_scmi/voltage.c @@ -401,7 +401,7 @@ static const struct scmi_voltage_proto_ops voltage_prot= o_ops =3D { .level_get =3D scmi_voltage_level_get, }; =20 -static int scmi_voltage_protocol_init(const struct scmi_protocol_handle *p= h) +static int scmi_voltage_protocol_init(struct scmi_protocol_handle *ph) { int ret; struct voltage_info *vinfo; --=20 2.51.0 From nobody Fri Apr 17 01:46:32 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 14ED5379996 for ; Tue, 24 Feb 2026 10:43:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929835; cv=none; b=N4UgNUhanTndnhHsItj8dg2pGsfIHKhIE4MU5dWVTu1o8f7nasT9ueqPE7h7oKeHRqrAZO1vtlD1XLKFsS2Z32LsV3IuG3hV8Z0RwAcv6Or87OHYPt3hdv2werxOSK74yUnxWsUZVdT+jXm0IGu/moDhCUTI+FvNjmuEB5psFng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929835; c=relaxed/simple; bh=Fe4MjhMn8lZ84KxqMdgpBwRbEDyKHabOEHVEnVI2kpg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G12PzYs01M2M4BBucCToCxEeP4IEtHqcwaSUMCTRUWAqzpAYxfnqdTPi4L83atKH6NmlbmxHNWqVVZosWm/2cS8wgWiW4kjaj+iAQC75Ren6lPOIxvI74JFus7s4Nug2hcY5RTWHwzTNxxHwqfwixtWvMYL+1N0xcyYd3zQ3qG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=D9v3qx8o; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VNEke9zH; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="D9v3qx8o"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VNEke9zH" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61OAFKfZ1446189 for ; Tue, 24 Feb 2026 10:43:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OZ4E54OvU7h144U3LHJamjkNTkG1gc0xqf9JFK5pbkI=; b=D9v3qx8o/f75VsT/ LhL4bFzaO03AVDp1hmkLJWmKeXl6N8puQxT2VpFjhcj5v8ELcW0JtAtalWMSUIZP 3pV5FCZLs5BKt95sc/ebDVXvmj48cxHbfbt0CbrGQOxcYkL88Iy70In2gQAaGCdc +cr4iEqs2rCL1kq6FIw4gwDUOd4jW0e3oJWHpk8+8o8w4JZCZDRyHMAXBjYG7AuM qlCbmEoe8IMRhYd/fnXTl59jp0anjm8qrEtDaCOBvQSBODiGRRBY7C6+HahIzx+e NJ256yntk82Jtw+sBmGnspNvusljYofkYBaIz8Ssd1WaVHxqtwrPIOJROK5usNfR UQntIQ== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgtv9ttj3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 10:43:53 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c70ab7f67fso3843493785a.3 for ; Tue, 24 Feb 2026 02:43:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771929832; x=1772534632; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OZ4E54OvU7h144U3LHJamjkNTkG1gc0xqf9JFK5pbkI=; b=VNEke9zHic4fjdgHtQ2QxyHI84g0RiRDnsRGmVQLPqwhKLz0YOh33dfZJIBfmxyIEm Rwcha8kBpPuNdaXyVHXTAs4Vq9PJahSkQS/MNntr3ui2prjeYOx6Y3q/tP8wkJHwjuNT a1v+CyKYfBpImhl+Ot/Ezd6K+SP2yIS5Y//zobeohthqCnjn6cU9tznsvbvLNsRP1tPw mtKLIXP6tR9eNSlEFo8ybLZeKfa+nJzm6qkNQmgfJdkbQthrRgW9RRUeFGHg35eGrA8r aD+MkWe4PI0r2MXn0K80GNJJHVnsNC/6LXRF7HNzRkmTahDcAtuo2h6zQU8saQwnm+Ij CmRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771929832; x=1772534632; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OZ4E54OvU7h144U3LHJamjkNTkG1gc0xqf9JFK5pbkI=; b=AhqNXiISc+00JJnnYHKT4Wg8znPT01+1DWNu6sbhYNHXv49i/DbS0sPvUettiD5yWF f+rgZb2cW8DlQebb1GrdzYyYENRpFkzSFQghpwlFSqkOSS48dPiXlWEFpZOzQnGV0j34 dDl7TVzRDix9umpYE4e0h7SSa7SFjmWX0h+k5gtwHQH50ZprlcTuwBGjIo/C6mORS1qp LoiT4BUI1oXECAiwpc9RMnOwGCn3AZrRPVDCkqNBT2rd9sCegKKjYRWXeKaGkmsAvm3L FklkPMityhWmIpLNtqjibgiI8uYUEu9x42W/72B/TRkAm1fjdRX86yvsf3npGMrTE5lp R5mw== X-Forwarded-Encrypted: i=1; AJvYcCW8pxgRbY5uS/80RiS8be+Px3U3WC1LHjoMNAaelDXMoRdT+o97UFoNpAWOyxMs1DD2g2HIeQDT3GCHMUs=@vger.kernel.org X-Gm-Message-State: AOJu0YzL7xvCXRCmgzLYecA/0iMreNaiK3hTibSd+YOcvDx/JChwZUeT fAoS+lxaNMf79oGiINcnGIIMvf8LyS0ryU6nuBr0Ftyc5oPO9EPeKT212cJNYCjgU8voS26WBbg bRtFnIQkAnR9JRLO0ySSlLaPkn/f8cOCWyyh8k5+pAV7DUZsnFk1NAgCjfPs42pDQGUIIkMMNwI Q= X-Gm-Gg: AZuq6aIbgsWVyp+6o/a4uxLmxGMZ6aPthShlc/64dA9emyTGm1I+/euV8jpGihS23QR U5inhSATXxhVXuGssNgDawwzzEjDHHwkskxgpaXNlajuGy05C34fXgtedVr08fStRwiBwU5v6FC NCZMZPAO7H7zkX5GtvhBrKcHAOfYT32CHpxoQ31rDDReEkFkIOMtsWNUbn+tFjkbU4x7wz17R+W vWFvBXf23IELF7O/W3r2/YyAYSuFXNev73v+gKI1iDf9fWp+NtHju5dvxYbJCze2/vz0GKF2lcf iEv9DYQkSYAZlDSKZSF2m3Jy/wkZeUDbTOU1Fz8XiOQzIlWMZcmsBo0IYcfFbyWEEF9NXcC1qDk Gthh2lngp/Aomm7v2mke2Urvppw5geYWTUDNVtbOD9YFx4Q== X-Received: by 2002:a05:620a:1a93:b0:8ca:ffe3:33a3 with SMTP id af79cd13be357-8cb8c94311fmr1569673185a.0.1771929832048; Tue, 24 Feb 2026 02:43:52 -0800 (PST) X-Received: by 2002:a05:620a:1a93:b0:8ca:ffe3:33a3 with SMTP id af79cd13be357-8cb8c94311fmr1569670385a.0.1771929831544; Tue, 24 Feb 2026 02:43:51 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.140]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d40004sm25685906f8f.21.2026.02.24.02.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 02:43:50 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 24 Feb 2026 11:43:41 +0100 Subject: [PATCH 3/4] firmware: arm_scmi: Use container_of_const() on scmi_handle Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-handle-not-const-v1-3-90bf93b53e27@oss.qualcomm.com> References: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> In-Reply-To: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> To: Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd , Peng Fan , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2933; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=Fe4MjhMn8lZ84KxqMdgpBwRbEDyKHabOEHVEnVI2kpg=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpnYDesakxrpxNl4CWrKKBXT6ZbDgoQ8kFNfECs nXEUwiwftSJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaZ2A3gAKCRDBN2bmhouD 11AiD/9ru5hTRR38swT4NSjVHe7EPcPuJOJK0VitxSDyeTmSfPuBgQRbAy9FX60bP6ZNbyUcs7J 7zbaHko1wWuuTXZYzbrSmHb3mNOKD3/dZkpeqCFPZap8bl7aNABQ/4eE79Pv/RiZbsDOP8BZEfZ kK6kKzWftbzhLwIcHfKMBbGQVmJRlir5iynhvi9cTCSnvEdF5tD4c/I+RiggOQkijoLjfwxD2og MYA6jylgYDTW1Bk9088jvtfJbNX48H9YfQZnkMxcgHVWXrLPIcWmMNNTkgbw8Zu/4mu/dpYxeDc rCL2vtq50RM2JjDXpoxqvPtuYJ+fLSocWFAm/P7wA+FHlr08TEZGiDnCZjO007ST6oO7p3gIpT1 2NqT0MLKjwzKwGgk9WN5IkoAz0k8cWo1pOilBgx8ZgbT5eZGSBg8H3jfrMtBdeCTDL6CxGMJEX7 JUuVdug8yMxTh4QLkTY/YqWNINWPAAv8r4pMJl6oCFPnH8ZExy2V7fUUYjuK/W1WQCDTpEBblcv JwpQ/gtTGjPeatMVQvmmHAw422D6PDLpPRKpTRcNxoIrukFBsHcQirWIYdw5zlCRYiaN2C1frLV nH0mdavtUPUZfSYjYI65KS7eXUR50nhSFJqYPvNlQYRcEq5Bi8eQ05JGDjo/qKklmOkzTAG/Ggb ZIt4m0sUR/ULbfQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Authority-Analysis: v=2.4 cv=Vaf6/Vp9 c=1 sm=1 tr=0 ts=699d80e9 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=6nO30s3o7FuWeffXwhKHTA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=vFoygJ3d8N6QX0cQTZYA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA4NyBTYWx0ZWRfX3X4xasL/96NQ jR2ZyU4PC8kvV9p7de4WiTXlJlJ2LbDdDjiiTPU7yvI2gSrsBuYwknN9a6VRNUp28gob/GPYk0X wLvuVQwS9CkQ0j79zxzRMpQmDNw0FQCLzW/1YM85cwGeB7SCzHdzMGqkTwKOH9B6bN+ftzarZtA Lh6TUkoSZGqw65VYHu0C1V/wTczKjXCHhLpQFmMHzAT613laHk/KOALuGaEWM+qLeXZ0qqZ6E5N xXYO7GwRaymwtWkKBqGyh3OTU5xtvmaYgoo5kJ3gYNVT0mp8zWboL6GsNg6+h63NPn/eYpzNlpK z/JpsbCOX9RMWrwq9FAzU9C0b0k4f7DpYikQYJu2+bVSgCNQ8VedYC+NyDdoPVzPI7XTVJj92qx 8ozfCXj6J+vjNUPRMlamt7Pj4hj7R8slG9OQ64LNO852oq4vsabtWRIQozIgonQwahnDsYWR2eu Ce+kRexPO3NuArIOoJA== X-Proofpoint-ORIG-GUID: Lmh6U3Gu5jAZNIP8HKEe6utHJw-yDLdY X-Proofpoint-GUID: Lmh6U3Gu5jAZNIP8HKEe6utHJw-yDLdY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_01,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 bulkscore=0 malwarescore=0 suspectscore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240087 Functions receiving pointer to const scmi_handle and are not modifying data in containing struct, can switch to safer container_of_const() which does not drop the const while casting. This improves readability because makes the code more obvious. Signed-off-by: Krzysztof Kozlowski --- drivers/firmware/arm_scmi/driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi= /driver.c index 951711aa7d33..cc6cdb7017cf 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -174,6 +174,7 @@ struct scmi_info { }; =20 #define handle_to_scmi_info(h) container_of(h, struct scmi_info, handle) +#define handle_to_scmi_info_const(h) container_of_const(h, struct scmi_inf= o, handle) #define tx_minfo_to_scmi_info(h) container_of(h, struct scmi_info, tx_minf= o) #define bus_nb_to_scmi_info(nb) container_of(nb, struct scmi_info, bus_nb) #define req_nb_to_scmi_info(nb) container_of(nb, struct scmi_info, dev_req= _nb) @@ -450,7 +451,7 @@ void scmi_notification_instance_data_set(struct scmi_ha= ndle *handle, =20 void *scmi_notification_instance_data_get(const struct scmi_handle *handle) { - struct scmi_info *info =3D handle_to_scmi_info(handle); + const struct scmi_info *info =3D handle_to_scmi_info_const(handle); =20 /* Ensure protocols_private_data has been updated */ smp_rmb(); @@ -866,7 +867,7 @@ static void scmi_bad_message_trace(struct scmi_chan_inf= o *cinfo, u32 msg_hdr, enum scmi_bad_msg err) { char *tag; - struct scmi_info *info =3D handle_to_scmi_info(cinfo->handle); + const struct scmi_info *info =3D handle_to_scmi_info_const(cinfo->handle); =20 switch (MSG_XTRACT_TYPE(msg_hdr)) { case MSG_TYPE_COMMAND: @@ -1062,7 +1063,7 @@ static inline void scmi_xfer_command_release(struct s= cmi_info *info, __scmi_xfer_put(&info->tx_minfo, xfer); } =20 -static inline void scmi_clear_channel(struct scmi_info *info, +static inline void scmi_clear_channel(const struct scmi_info *info, struct scmi_chan_info *cinfo) { if (!cinfo->is_p2a) { @@ -1240,7 +1241,7 @@ static bool scmi_xfer_done_no_timeout(struct scmi_cha= n_info *cinfo, struct scmi_xfer *xfer, ktime_t stop, bool *ooo) { - struct scmi_info *info =3D handle_to_scmi_info(cinfo->handle); + const struct scmi_info *info =3D handle_to_scmi_info_const(cinfo->handle); =20 /* * Poll also on xfer->done so that polling can be forcibly terminated @@ -3459,7 +3460,7 @@ static struct dentry *scmi_debugfs_init(void) int scmi_inflight_count(const struct scmi_handle *handle) { if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) { - struct scmi_info *info =3D handle_to_scmi_info(handle); + const struct scmi_info *info =3D handle_to_scmi_info_const(handle); =20 if (!info->dbg) return 0; --=20 2.51.0 From nobody Fri Apr 17 01:46:32 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 B7BE9379982 for ; Tue, 24 Feb 2026 10:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929837; cv=none; b=BbrVwEWVHak8eiFnas3GGhwc/NfD23SQ6Dqd6klelwPP7JKSYIh8yULuRNRo1NRsIBH409Dec5iLeKz6cGjt+pd/bI/I30dbF6jU7UYEeSEjcrSCSaaNGJz7vV4yEwio0sM6DOwE4ejFCsjwOiaKtG/hdIKjLh/03NS+VM1S0lc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771929837; c=relaxed/simple; bh=7h/Lj1fVzQNHqbpgOXMHGQLnYHp9vdXyxXswRQGiGq0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m3uMbQmcXpUeMZ+Uc1hb8O60iEBhVqNmG8tEMgXAP/MqD4nK2QDofZwn5NES+P2Opr3nL4ruq71HyhUD7UYi6p+NGtvKrt0d3rDgd9wSrtafR1rduE3jREAOjC8omlngPsdxa+C4ce3059aTaMR0M3vUOYG7gHiQQT8KysV3SNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TfQuzWYs; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=STX4ky2p; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TfQuzWYs"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="STX4ky2p" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61OAFVLL2284579 for ; Tue, 24 Feb 2026 10:43:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Ne7yOu90dPGQgrUhRBv6heI97JqK1q/WEP2CV9u0asA=; b=TfQuzWYs6V+a7MZr M7JONU3S/pDgfd/PtBI3vHsOjR2pnj6TRjYGhinFdHTNnQ1As5UKVFMMq/2aCnnG NAsCci4nAQWnqM6uKy1CHPYr/ernPrwYcWBL/Xk/LVqQymzHAuAGdO8zhFyRioTV v9rxC1d9vilxIyswyr0jl9S/EIdalqYqCpekjtQ8jCRstzupMTlrbfqmQMVYfTVc xtcLj/ybHn4C11BtZrfq40vrCn26AOQsUbnOKTEv4k4M8peo+H97OiNIIbmPh+bE 4+hgJFEEG2eh7ujyCXfNl4E/1MyT/0LnogYRMQaSEXcRlUfOl+DEyhhYOYXOTgoq 8Th3sg== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgtx0asd3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 10:43:55 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8cb3b0d938dso5181197785a.2 for ; Tue, 24 Feb 2026 02:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771929834; x=1772534634; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ne7yOu90dPGQgrUhRBv6heI97JqK1q/WEP2CV9u0asA=; b=STX4ky2pKiHS0rNFv4kGH0wThSzuRjvvMMh2rbuwiwR57IdHKRmOCLmRAyU2//H5w8 nWD8O3DINyG/SMKpft2tlVdi+0d6ebrF1SPSw2sYBlad1Kvwib1z5vHCIDKak/2toS5L wLEznFEpDjALkfN/KOhJodVWOqqu/YWmlm9OQzDFKhvUQPwP/7ZFYZwuTjupgXYdl2L2 /0wsDSRRgr4EsgYU2tpS7e0h14GoBIfn0HD8lDkN+8VgyflZFsHvYYAoqQJBhxf7QHUA wYRpLAqNyoA8b0RU+i4YXXBnrug628LlW10q8FZIrVB40n5chws10IAly3QJ5C8ljSpm Z54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771929834; x=1772534634; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Ne7yOu90dPGQgrUhRBv6heI97JqK1q/WEP2CV9u0asA=; b=YLdoOCAmrjPS9UFwN6eKOOKi1uB3HvoNL4P5Z6po+Ct5YxaFgb++HMOm0/nq8L5xa0 sm+sv7ZZcHvy5du4cLemVJXcwo7E/zHMX2CHfJxd9EU8AOOcW4WaZnutyNvW5t3c0nwb JUwoF+dQq5vZFLkMCTHMtIJ2H1r/Q/8G3VWG4lEUP2N8HLxzhI4JAJXqu2XLPkxDxYuj bqxcrrCFdU91Fw700cGP5G+PlH89sBU3W9ub9jIRkcAh7UmglZd0CFrjErUce/shyvcr N6C45Gwdlc5cCDhGIVYnP5yUJxKDE4YjyygRjuFs9Sxjn35cylP/lRINyv60fNzgWKJw h6vA== X-Forwarded-Encrypted: i=1; AJvYcCXMqSmS+v3o5yZE0/RmMiGhL4rnrKmZUgr8W4U0p+XdTro9nwQqGFYxr6R1/tCxTo3cY5/to02jrzgIsak=@vger.kernel.org X-Gm-Message-State: AOJu0YzPomztE1IRkfdMqTX+wJFUQtozpNOVvZqcjUb8G0Se+l48zrlB PwlbBdb+rxAz1VE3YRwgbSCw/wyFIj4+G2jcI0PYy+h0FxacFRrfw5FZ51B8FJfJ48kFDhmliUL u83j8qlLY/U3yBCE5SsmFaeCgazof8UuAymn/Od4DUzGI4xFTTv100/2U0Jzb8fUi7cz1fRZCfa I= X-Gm-Gg: AZuq6aIej6hvztPxJNbJ0lFegCy0ZxCpNpYvkUv3iCN6ud+sa14xWKtRAUJqPvfUve2 JbQZqYD6eiy1JQQepV1P/wRbAq4tCK77LjdVs46RUJwJcTWF+OjipsQnaAJ3FjARnuQo1bobSBT UF2SWWPSrzyTTqtwhVQcTeKDYv75M5ooafV2S021+SQnU+rqRkbuuW4hDZOCp8bBPGlx6CwK+cU Yce1hFpxiAgIZ1CRQ9/xrBnC+VJrA74DJuEboOY8eugaJ5NOrgrJcx0rUJlBzqT6FpDirH0m55B KrecF3Ns08Y3qyCEO43cvHy863xOPyrHHglJ1ZaLUVhGqmhJ5uWUlC/O4lV1G+SOSIJTXmAYibx kZH1GVav63LBLv1i6PL1iuTS1EnP4TI4NxO4F0bVznMSa2g== X-Received: by 2002:a05:620a:280c:b0:8c6:ff8f:58af with SMTP id af79cd13be357-8cb8ca674bcmr1328012485a.51.1771929833717; Tue, 24 Feb 2026 02:43:53 -0800 (PST) X-Received: by 2002:a05:620a:280c:b0:8c6:ff8f:58af with SMTP id af79cd13be357-8cb8ca674bcmr1328009985a.51.1771929833267; Tue, 24 Feb 2026 02:43:53 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.140]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d40004sm25685906f8f.21.2026.02.24.02.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 02:43:52 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 24 Feb 2026 11:43:42 +0100 Subject: [PATCH 4/4] firmware: arm_scmi: Use container_of_const() on scmi_protocol_instance Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-handle-not-const-v1-4-90bf93b53e27@oss.qualcomm.com> References: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> In-Reply-To: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> To: Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd , Peng Fan , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4567; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=7h/Lj1fVzQNHqbpgOXMHGQLnYHp9vdXyxXswRQGiGq0=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpnYDf4rZiAuG6azRnIxmXqPEv0a1/T70K4tGK4 QP9Dmw1vw6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaZ2A3wAKCRDBN2bmhouD 1wDdD/43Tz0/D5jgcP/JaZaTJn5X30WjBrCxt9pL9IIr2CExuUF8RvV3UVEFqSDruYaLY5xV+nj AE4rp6GAxvDCXBdFG4xpPkgnVW3BpbCf3z/GvNJ0QrxSQlpG8j5/nEYjECCevxyMMafQYWSNTD7 0UobXEhsOcJDpZJCaslgR+Fz9zAS2M4fYw0MNvt/NKMYEeqfzFz+LOHDm+gD7s+N33ztv6ehEgt FfxiM53R83gSRbQm3C4MDYA5kwh8yZC2pMmW6Ggf3qjL4NBrJqx8mjnODFE9PQK6kiSj3NQnfq8 cPBpVYf6zckkoB3wVbdMpHKT2zWoiYxT7w/3p0MF83zkInjpv/E5PwcJBCRLrhA5GBDY+uoIjha j1upzMWegB56pqV2WFHpyXrEGTpKmC56ew0/SjFviE6pf52HCBiZFVihc4inyUt3bGxzRXFhfuB QZe2pAMXJ28FUEaFKuc+AgVrxnAsJg9N8OCRojP33zU1dGlRx5tm8Hrfwz9ACSNrLjp2C/uVKCK MJafuDcbvHS07QMdPslmOIkDT7MseZvDpXBY4IXZiBxq+5/LX5d98P6sEhPFWvEzkV+wXY6TqM4 ZUtlBHJOmsCqD2wo2Uk2jjJlTPFWdpdg4LLgbCzjBCxLMUlLcieW35Tn5PI7+emQKJ9h23X2c8G izF8oAxXnVfQFjA== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: 0OKJt5EhASWHnlbZTKFBNErs-DbtPfjh X-Authority-Analysis: v=2.4 cv=euvSD4pX c=1 sm=1 tr=0 ts=699d80eb cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=6nO30s3o7FuWeffXwhKHTA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=BpvVLMS52MUaY0b39kYA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-GUID: 0OKJt5EhASWHnlbZTKFBNErs-DbtPfjh X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA4NyBTYWx0ZWRfX7ITuQSug0x/l YN34ncnsQHDhcmFHYWj2/DQJG3OdT+5xxBt40NKtqAfpxyzjWk60bG2pMvOhsFpNqmJkqe691tu qEEWvJIWk2+ZTAnqC4Xtd11DHZwBGMPmdeMtRTf0Z1q3f89zyh2t8GBMh7m6HNJVDmaZzZeKOTA uTqE51mkjjSRjuHoYgItNIGkfbiML14vAzC9WRdwbuKtPqAd5If8wZg3+lxTUgBA7kV4YmA2uLX DCMcuzeyuHTW79a3/mt0y6TSVJpZ9O6L7D3ntpAQ0zP5ONNylIjigr+JLAPniyp/lgbPdFueFlM z4sy++OoWxI2MwPM4tTCc4pL0x9/MRjFvUgDGTSR0+2WOJfIKjrsKkc5mgwv2nR0SuWpbzRJO7E 2mAAPazivZOPm9fAgR3t2YMDpKAX6Fv2fxJ1SrFkyqhjRw3SXhB4fBcZCR4SKGRaOfhZVXl6rKw XwbR5M5hAFyaKJo9BnA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_01,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 bulkscore=0 impostorscore=0 phishscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240087 Functions receiving pointer to const scmi_protocol_instance, and are not modifying data in containing struct, can switch to safer container_of_const() which does not drop the const while casting. This improves readability because makes the code more obvious. Signed-off-by: Krzysztof Kozlowski --- drivers/firmware/arm_scmi/driver.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi= /driver.c index cc6cdb7017cf..933b90f42794 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -114,6 +114,7 @@ struct scmi_protocol_instance { }; =20 #define ph_to_pi(h) container_of(h, struct scmi_protocol_instance, ph) +#define ph_to_pi_const(h) container_of_const(h, struct scmi_protocol_insta= nce, ph) =20 /** * struct scmi_info - Structure representing a SCMI instance @@ -1231,7 +1232,7 @@ static void scmi_rx_callback(struct scmi_chan_info *c= info, u32 msg_hdr, static void xfer_put(const struct scmi_protocol_handle *ph, struct scmi_xfer *xfer) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); =20 __scmi_xfer_put(&info->tx_minfo, xfer); @@ -1394,7 +1395,7 @@ static int do_xfer(const struct scmi_protocol_handle = *ph, struct scmi_xfer *xfer) { int ret; - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); struct device *dev =3D info->dev; struct scmi_chan_info *cinfo; @@ -1473,7 +1474,7 @@ static int do_xfer(const struct scmi_protocol_handle = *ph, static void reset_rx_to_maxsz(const struct scmi_protocol_handle *ph, struct scmi_xfer *xfer) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); =20 xfer->rx.len =3D info->desc->max_msg_size; @@ -1556,7 +1557,7 @@ static int xfer_get_init(const struct scmi_protocol_h= andle *ph, { int ret; struct scmi_xfer *xfer; - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); struct scmi_xfers_info *minfo =3D &info->tx_minfo; struct device *dev =3D info->dev; @@ -1650,7 +1651,7 @@ static int scmi_set_protocol_priv(struct scmi_protoco= l_handle *ph, */ static void *scmi_get_protocol_priv(const struct scmi_protocol_handle *ph) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); =20 return pi->priv; } @@ -1720,7 +1721,7 @@ static int scmi_common_extended_name_get(const struct= scmi_protocol_handle *ph, */ static int scmi_common_get_max_msg_size(const struct scmi_protocol_handle = *ph) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); =20 return info->desc->max_msg_size; @@ -1914,7 +1915,7 @@ scmi_common_fastchannel_init(const struct scmi_protoc= ol_handle *ph, struct scmi_fc_db_info *db =3D NULL; struct scmi_msg_get_fc_info *info; struct scmi_msg_resp_desc_fc *resp; - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); =20 /* Check if the MSG_ID supports fastchannel */ ret =3D scmi_protocol_msg_check(ph, message_id, &attributes); @@ -2067,7 +2068,7 @@ static const struct scmi_proto_helpers_ops helpers_op= s =3D { struct scmi_revision_info * scmi_revision_area_get(const struct scmi_protocol_handle *ph) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); =20 return pi->handle->version; } @@ -2366,7 +2367,7 @@ void scmi_protocol_release(struct scmi_handle *handle= , u8 protocol_id) void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph, u8 *prot_imp) { - const struct scmi_protocol_instance *pi =3D ph_to_pi(ph); + const struct scmi_protocol_instance *pi =3D ph_to_pi_const(ph); struct scmi_info *info =3D handle_to_scmi_info(pi->handle); =20 info->protocols_imp =3D prot_imp; --=20 2.51.0