Constify struct scmi_voltage_proto_ops since the driver never modifies
it. Placing it in read-only memory (.rodata) improves hardening,
particularly because it contains function pointers.
x86_64 (allmodconfig) size impact:
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@wanadoo.fr>
Message-Id: <
2091660c072dd2d5599897243a5d69e89d46ed4d.
1753816459.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
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,