]> Gentwo Git Trees - linux/.git/commit
firmware: arm_scmi: Constify struct scmi_voltage_proto_ops
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 29 Jul 2025 19:15:03 +0000 (21:15 +0200)
committerSudeep Holla <sudeep.holla@arm.com>
Thu, 21 Aug 2025 13:14:59 +0000 (14:14 +0100)
commitabd658d3e7332bc88ae910664c7d5f4e116d6bde
tree4b5df3860d2e9e14b5fee7d9c9533405b05264b0
parenta4d5f63d4384533101e0308fb2e9ac16bacc446c
firmware: arm_scmi: Constify struct scmi_voltage_proto_ops

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>
drivers/firmware/arm_scmi/voltage.c