Skip to content

Commit

Permalink
tpm/ppi: Constify static struct attribute_group
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
  • Loading branch information
Rikard Falkeborn authored and Jarkko Sakkinen committed Feb 16, 2021
1 parent 52d0848 commit 90cba8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/char/tpm/tpm-chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ static void tpm_devs_release(struct device *dev)
{
struct tpm_chip *chip = container_of(dev, struct tpm_chip, devs);

dump_stack();

/* release the master device reference */
put_device(&chip->dev);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/tpm/tpm_ppi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 90cba8d

Please sign in to comment.