diff options
author | Rohan McLure <rmclure@linux.ibm.com> | 2022-03-08 10:14:14 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-03-08 22:15:32 +1100 |
commit | 6b3a3e12f8e6eea47428bb39aaf58832b50bb379 (patch) | |
tree | 0f38c62d684a4f16fa4cfa0f70dedab6244b2785 /arch/powerpc/platforms/cell | |
parent | 5986f6b6575ac830ede9648cfb64353c58067a9f (diff) | |
download | linux-stable-6b3a3e12f8e6eea47428bb39aaf58832b50bb379.tar.gz linux-stable-6b3a3e12f8e6eea47428bb39aaf58832b50bb379.tar.bz2 linux-stable-6b3a3e12f8e6eea47428bb39aaf58832b50bb379.zip |
powerpc: declare unmodified attribute_group usages const
Inspired by (bd75b4ef4977: Constify static attribute_group structs),
accepted by linux-next, reported:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220210202805.7750-4-rikard.falkeborn@gmail.com/
Nearly all singletons of type struct attribute_group are never modified,
and so are candidates for being const. Declare them as const.
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220307231414.86560-1-rmclure@linux.ibm.com
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/cbe_thermal.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c index 2ece77f49bc3..abb5e527b4db 100644 --- a/arch/powerpc/platforms/cell/cbe_thermal.c +++ b/arch/powerpc/platforms/cell/cbe_thermal.c @@ -255,7 +255,7 @@ static struct attribute *spu_attributes[] = { NULL, }; -static struct attribute_group spu_attribute_group = { +static const struct attribute_group spu_attribute_group = { .name = "thermal", .attrs = spu_attributes, }; diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 83cea9e7ee72..2eecba3345c3 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -490,7 +490,7 @@ int spu_add_dev_attr(struct device_attribute *attr) } EXPORT_SYMBOL_GPL(spu_add_dev_attr); -int spu_add_dev_attr_group(struct attribute_group *attrs) +int spu_add_dev_attr_group(const struct attribute_group *attrs) { struct spu *spu; int rc = 0; @@ -529,7 +529,7 @@ void spu_remove_dev_attr(struct device_attribute *attr) } EXPORT_SYMBOL_GPL(spu_remove_dev_attr); -void spu_remove_dev_attr_group(struct attribute_group *attrs) +void spu_remove_dev_attr_group(const struct attribute_group *attrs) { struct spu *spu; |