Skip to content

Commit

Permalink
crypto: nx - Constify static attribute_group structs
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Rikard Falkeborn authored and Herbert Xu committed Feb 18, 2022
1 parent 83b5a23 commit bd75b4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/crypto/nx/nx-common-pseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit bd75b4e

Please sign in to comment.