From: David Windsor Date: Tue, 5 May 2026 20:27:38 +0000 (-0400) Subject: tpm: svsm: constify tpm_chip_ops X-Git-Tag: v7.2-rc1~63^2~9 X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=ebc242f78c52ef9de0e650bf48f64eb110351a4f;p=thirdparty%2Flinux.git 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 Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20260505202738.145800-1-dwindsor@gmail.com Signed-off-by: Jarkko Sakkinen --- diff --git a/drivers/char/tpm/tpm_svsm.c b/drivers/char/tpm/tpm_svsm.c index f5ba0f64850b9..b74d60f687d5b 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, };