From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>,
Cristian Marussi <cristian.marussi@arm.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Peng Fan <peng.fan@nxp.com>,
Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>
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 <krzysztof.kozlowski@oss.qualcomm.com>
Subject: [PATCH 0/4] firmware: arm_scmi: Drop fake 'const' on scmi_handle
Date: Tue, 24 Feb 2026 11:43:38 +0100 [thread overview]
Message-ID: <20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com> (raw)
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 = handle_to_scmi_info(handle);
And with such cast the handle is easily writable with simple:
info->handle.dev = 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).
Best regards,
Krzysztof
---
Krzysztof Kozlowski (4):
firmware: arm_scmi: Drop fake 'const' on scmi_handle
firmware: arm_scmi: Drop fake 'const' on scmi_protocol_handle
firmware: arm_scmi: Use container_of_const() on scmi_handle
firmware: arm_scmi: Use container_of_const() on scmi_protocol_instance
drivers/clk/clk-scmi.c | 2 +-
drivers/firmware/arm_scmi/base.c | 2 +-
drivers/firmware/arm_scmi/clock.c | 2 +-
drivers/firmware/arm_scmi/common.h | 15 +++---
drivers/firmware/arm_scmi/driver.c | 58 +++++++++++-----------
drivers/firmware/arm_scmi/notify.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/raw_mode.c | 4 +-
drivers/firmware/arm_scmi/raw_mode.h | 2 +-
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 +-
.../firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 2 +-
drivers/firmware/arm_scmi/voltage.c | 2 +-
include/linux/scmi_protocol.h | 2 +-
22 files changed, 60 insertions(+), 59 deletions(-)
---
base-commit: 5848db9e2caaa560a21ce692c4c32badef3c813f
change-id: 20260223-handle-not-const-9a6eb5529590
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
next reply other threads:[~2026-02-24 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 10:43 Krzysztof Kozlowski [this message]
2026-02-24 10:43 ` [PATCH 1/4] " Krzysztof Kozlowski
2026-02-24 10:43 ` [PATCH 2/4] firmware: arm_scmi: Drop fake 'const' on scmi_protocol_handle Krzysztof Kozlowski
2026-02-24 10:43 ` [PATCH 3/4] firmware: arm_scmi: Use container_of_const() on scmi_handle Krzysztof Kozlowski
2026-02-24 10:43 ` [PATCH 4/4] firmware: arm_scmi: Use container_of_const() on scmi_protocol_instance Krzysztof Kozlowski
2026-02-24 12:31 ` [PATCH 0/4] firmware: arm_scmi: Drop fake 'const' on scmi_handle Cristian Marussi
2026-02-25 11:42 ` Krzysztof Kozlowski
2026-02-26 13:55 ` Cristian Marussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224-handle-not-const-v1-0-90bf93b53e27@oss.qualcomm.com \
--to=krzysztof.kozlowski@oss.qualcomm.com \
--cc=Frank.Li@nxp.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=stable@vger.kernel.org \
--cc=sudeep.holla@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®