tpm/ppi: Constify static struct attribute_group
Subsystems (2)
PATCH 1/1 tpm/ppi: Constify static struct attribute_group
The only usage of ppi_attr_grp is to put its address in an array of pointers to const struct attribute_group. Make it const to allow the compiler to put it in read-only memory.
--- drivers/char/tpm/tpm_ppi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_ppi.c +1 -1
@@ -358,7 +358,7 @@ static struct attribute *ppi_attrs[] = { &dev_attr_tcg_operations.attr, &dev_attr_vs_operations.attr, NULL, }; -static struct attribute_group ppi_attr_grp = { +static const struct attribute_group ppi_attr_grp = { .name ="ppi" , .attrs = ppi_attrs };
Signature · 1 line
2.30.0
Quoted 5 lines · Rikard Falkeborn
The only usage of
ppi_attr_grpis to put its address in an array of pointers to const structattribute_group. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
Thanks.
/Jarkko
Quoted 21 lines
--- drivers/char/tpm/tpm_ppi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/tpm/tpm_ppi.c +1
-1@@ -358,7 +358,7 @@ static struct attribute *ppi_attrs[] = { &dev_attr_tcg_operations.attr, &dev_attr_vs_operations.attr, NULL, }; -static struct attribute_group ppi_attr_grp = { +static const struct attribute_group ppi_attr_grp = { .name ="ppi" , .attrs = ppi_attrs };Signature · 1 line
2.30.0
Quoted 5 lines · Jarkko Sakkinen
Quoted 4 lines · Rikard Falkeborn
The only usage of
ppi_attr_grpis to put its address in an array of pointers to const structattribute_group. Make it const to allow the compiler to put it in read-only memory.
Quoted 8 lines
Quoted 1 line
Signed-off-by Rikard Falkeborn <[email protected]>Thanks.
Reviewed-by Jarkko Sakkinen <[email protected]>/Jarkko
Hi Jarkko,
I saw this was merged as commit 90cba8d20f8b09d62a25f9864cb8e67722d76c3a, but in the commit, there was an additional change where a call to dump_stack() was added in drivers/char/tpm/tpm-chip.c, was this intentional?
/Rikard
Jarkko Sakkinen
maintainerQuoted 12 lines · Rikard Falkeborn
Quoted 11 lines · Jarkko Sakkinen
Quoted 5 lines · Rikard Falkeborn
The only usage of
ppi_attr_grpis to put its address in an array of pointers to const structattribute_group. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>Thanks.
Reviewed-by Jarkko Sakkinen <[email protected]>
Quoted 8 lines
Quoted 2 lines
/Jarkko
Hi Jarkko,
I saw this was merged as commit90cba8d20f8b09d62a25f9864cb8e67722d76c3a, but in the commit, there was an additional change where a call todump_stack()was added indrivers/char/tpm/tpm-chip.c, was this intentional?
No, thanks for reporting. I sent a fixup. Can you ack it?
/Jarkko