tpm: svsm: constify tpm_chip_ops
Subsystems (2)
PATCH 1/1 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.
--- drivers/char/tpm/tpm_svsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_svsm.c +1 -1
@@ -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, };
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
Signature · 1 line
2.53.0
Quoted 10 lines · David Windsor
Constify the SVSM vTPM ops. It is statically initialized and never written to, so let's store it in .rodata.
Every other
tpm_class_opsinstance indrivers/char/tpm/is already const.Signed-off-by David Windsor <[email protected]>---
drivers/char/tpm/tpm_svsm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
LGTM!
Quoted 25 lines · David Windsor
Constify the SVSM vTPM ops. It is statically initialized and never written to, so let's store it in .rodata.
Every other
tpm_class_opsinstance indrivers/char/tpm/is already const.Signed-off-by David Windsor <[email protected]>--- drivers/char/tpm/tpm_svsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/tpm/tpm_svsm.c +1
-1@@ -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, };
Quoted 4 lines
base-commit:
254f49634ee16a731174d2ae34bc50bd5f45e731Signature · 1 line
2.53.0
Thanks, applied.
BR, Jarkko