[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2091660c072dd2d5599897243a5d69e89d46ed4d.1753816459.git.christophe.jaillet@wanadoo.fr>
Date: Tue, 29 Jul 2025 21:15:03 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Sudeep Holla <sudeep.holla@....com>,
Cristian Marussi <cristian.marussi@....com>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
arm-scmi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 1/2] firmware: arm_scmi: Constify struct scmi_voltage_proto_ops
'struct scmi_voltage_proto_ops' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
13142 1808 0 14950 3a66 drivers/firmware/arm_scmi/voltage.o
After:
=====
text data bss dec hex filename
13238 1712 0 14950 3a66 drivers/firmware/arm_scmi/voltage.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Compile tested only
---
drivers/firmware/arm_scmi/voltage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/voltage.c b/drivers/firmware/arm_scmi/voltage.c
index fda6a1573609..17127880e10a 100644
--- a/drivers/firmware/arm_scmi/voltage.c
+++ b/drivers/firmware/arm_scmi/voltage.c
@@ -393,7 +393,7 @@ static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph)
return vinfo->num_domains;
}
-static struct scmi_voltage_proto_ops voltage_proto_ops = {
+static const struct scmi_voltage_proto_ops voltage_proto_ops = {
.num_domains_get = scmi_voltage_domains_num_get,
.info_get = scmi_voltage_info_get,
.config_set = scmi_voltage_config_set,
--
2.50.1
Powered by blists - more mailing lists