firmware: arm_scmi: Constify struct scmi_transport_ops

Mark struct scmi_transport_ops as const since this driver never modifies
it. Constifying moves it to read-only memory, improving hardening -
especially important for structures with function pointers.

x86_64 (allmodconfig) size diff:
Before:
   text    data     bss     dec     hex filename
   6907     680      48    7635    1dd3 drivers/firmware/arm_scmi/transports/optee.o

After:
   text    data     bss     dec     hex filename
   6987     576      48    7611    1dbb drivers/firmware/arm_scmi/transports/optee.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <881be6ad61037ed95d5e750a2565fd9840120a08.1753816459.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Christophe JAILLET 2025-07-29 21:15:04 +02:00 committed by Sudeep Holla
parent abd658d3e7
commit 224dcf2968

View File

@ -498,7 +498,7 @@ static void scmi_optee_mark_txdone(struct scmi_chan_info *cinfo, int ret,
mutex_unlock(&channel->mu);
}
static struct scmi_transport_ops scmi_optee_ops = {
static const struct scmi_transport_ops scmi_optee_ops = {
.chan_available = scmi_optee_chan_available,
.chan_setup = scmi_optee_chan_setup,
.chan_free = scmi_optee_chan_free,