summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Windsor <dwindsor@gmail.com>2026-05-05 23:27:38 +0300
committerJarkko Sakkinen <jarkko@kernel.org>2026-06-21 04:25:27 +0300
commitebc242f78c52ef9de0e650bf48f64eb110351a4f (patch)
treeb5733c36efff2d356a530047622e18dcb07d2e6a
parent1a3746ccbb0a97bed3c06ccde6b880013b1dddc1 (diff)
downloadlinux-ebc242f78c52ef9de0e650bf48f64eb110351a4f.tar.xz
tpm: svsm: constify tpm_chip_ops
Constify the SVSM vTPM ops. It is statically initialized and never written to, so let's store it in .rodata. Every other tpm_class_ops instance in drivers/char/tpm/ is already const. Signed-off-by: David Windsor <dwindsor@gmail.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://lore.kernel.org/r/20260505202738.145800-1-dwindsor@gmail.com Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
-rw-r--r--drivers/char/tpm/tpm_svsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_svsm.c b/drivers/char/tpm/tpm_svsm.c
index f5ba0f64850b..b74d60f687d5 100644
--- a/drivers/char/tpm/tpm_svsm.c
+++ b/drivers/char/tpm/tpm_svsm.c
@@ -49,7 +49,7 @@ static int tpm_svsm_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz,
return svsm_vtpm_cmd_response_parse(priv->buffer, buf, bufsiz);
}
-static struct tpm_class_ops tpm_chip_ops = {
+static const struct tpm_class_ops tpm_chip_ops = {
.flags = TPM_OPS_AUTO_STARTUP,
.send = tpm_svsm_send,
};