linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm/ppi: Constify static struct attribute_group
@ 2021-02-04 21:54 Rikard Falkeborn
  2021-02-05  2:04 ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Rikard Falkeborn @ 2021-02-04 21:54 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
  Cc: linux-integrity, linux-kernel, Rikard Falkeborn

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>
---
 drivers/char/tpm/tpm_ppi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index b2dab941cb7f..40018a73b3cb 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -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
 };
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tpm/ppi: Constify static struct attribute_group
  2021-02-04 21:54 [PATCH] tpm/ppi: Constify static struct attribute_group Rikard Falkeborn
@ 2021-02-05  2:04 ` Jarkko Sakkinen
  2021-02-26 21:56   ` Rikard Falkeborn
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2021-02-05  2:04 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On Thu, Feb 04, 2021 at 10:54:27PM +0100, Rikard Falkeborn wrote:
> 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>

Thanks.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

/Jarkko

> ---
>  drivers/char/tpm/tpm_ppi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
> index b2dab941cb7f..40018a73b3cb 100644
> --- a/drivers/char/tpm/tpm_ppi.c
> +++ b/drivers/char/tpm/tpm_ppi.c
> @@ -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
>  };
> -- 
> 2.30.0
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tpm/ppi: Constify static struct attribute_group
  2021-02-05  2:04 ` Jarkko Sakkinen
@ 2021-02-26 21:56   ` Rikard Falkeborn
  2021-03-01  9:44     ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Rikard Falkeborn @ 2021-02-26 21:56 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Rikard Falkeborn, Peter Huewe, Jason Gunthorpe, linux-integrity,
	linux-kernel

On Fri, Feb 05, 2021 at 04:04:18AM +0200, Jarkko Sakkinen wrote:
> On Thu, Feb 04, 2021 at 10:54:27PM +0100, Rikard Falkeborn wrote:
> > 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>
> 
> Thanks.
> 
> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
> 
> /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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tpm/ppi: Constify static struct attribute_group
  2021-02-26 21:56   ` Rikard Falkeborn
@ 2021-03-01  9:44     ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2021-03-01  9:44 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On Fri, Feb 26, 2021 at 10:56:12PM +0100, Rikard Falkeborn wrote:
> On Fri, Feb 05, 2021 at 04:04:18AM +0200, Jarkko Sakkinen wrote:
> > On Thu, Feb 04, 2021 at 10:54:27PM +0100, Rikard Falkeborn wrote:
> > > 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>
> > 
> > Thanks.
> > 
> > Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
> > 
> > /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?
 
No, thanks for reporting. I sent a fixup. Can you ack it?

/Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-01  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 21:54 [PATCH] tpm/ppi: Constify static struct attribute_group Rikard Falkeborn
2021-02-05  2:04 ` Jarkko Sakkinen
2021-02-26 21:56   ` Rikard Falkeborn
2021-03-01  9:44     ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).