mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] crypto/nx: Constify static attribute_group structs
Date: Fri, 11 Feb 2022 17:27:19 +1100	[thread overview]
Message-ID: <87tud5rk8o.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <20220210202805.7750-4-rikard.falkeborn@gmail.com>

Hi Rikard,

> The only usage of these is to pass their address to
> sysfs_{create,remove}_group(), which takes pointers to const struct
> attribute_group. Make them const to allow the compiler to put them in
> read-only memory.

I checked the file. Indeed, those structs are only used in
sysfs_{create,remove}_group. So I agree that they can be constified.

They also pass all the automated tests:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220210202805.7750-4-rikard.falkeborn@gmail.com/

Reviewed-by: Daniel Axtens <dja@axtens.net>

Kind regards,
Daniel

>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
>  drivers/crypto/nx/nx-common-pseries.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c
> index 4e304f6081e4..7584a34ba88c 100644
> --- a/drivers/crypto/nx/nx-common-pseries.c
> +++ b/drivers/crypto/nx/nx-common-pseries.c
> @@ -962,7 +962,7 @@ static struct attribute *nx842_sysfs_entries[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group nx842_attribute_group = {
> +static const struct attribute_group nx842_attribute_group = {
>  	.name = NULL,		/* put in device directory */
>  	.attrs = nx842_sysfs_entries,
>  };
> @@ -992,7 +992,7 @@ static struct attribute *nxcop_caps_sysfs_entries[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group nxcop_caps_attr_group = {
> +static const struct attribute_group nxcop_caps_attr_group = {
>  	.name	=	"nx_gzip_caps",
>  	.attrs	=	nxcop_caps_sysfs_entries,
>  };
> -- 
> 2.35.1

  reply	other threads:[~2022-02-11  6:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 20:28 [PATCH 0/3] drivers/crypto: Constify static attribute_group Rikard Falkeborn
2022-02-10 20:28 ` [PATCH 1/3] crypto: omap-aes - " Rikard Falkeborn
2022-02-10 20:28 ` [PATCH 2/3] crypto: omap-sham " Rikard Falkeborn
2022-02-10 20:28 ` [PATCH 3/3] crypto/nx: Constify static attribute_group structs Rikard Falkeborn
2022-02-11  6:27   ` Daniel Axtens [this message]
2022-02-18  5:37 ` [PATCH 0/3] drivers/crypto: Constify static attribute_group Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tud5rk8o.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=rikard.falkeborn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®