* [PATCH] powerpc: add const to bin_attribute structures
@ 2017-08-02 18:07 Bhumika Goyal
2017-08-18 12:50 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-08-02 18:07 UTC (permalink / raw)
To: julia.lawall, benh, paulus, mpe, linuxppc-dev, linux-kernel; +Cc: Bhumika Goyal
Declare bin_attribute structures as const as they are only passed as an
argument to the function sysfs_create_bin_file. This argument is of
type const, so declare the structure as const.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
arch/powerpc/platforms/powernv/opal-flash.c | 2 +-
arch/powerpc/sysdev/mv64x60_pci.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
index 4ec6219..2fa3ac8 100644
--- a/arch/powerpc/platforms/powernv/opal-flash.c
+++ b/arch/powerpc/platforms/powernv/opal-flash.c
@@ -520,7 +520,7 @@ static ssize_t image_data_write(struct file *filp, struct kobject *kobj,
* update_flash : Flash new firmware image
*
*/
-static struct bin_attribute image_data_attr = {
+static const struct bin_attribute image_data_attr = {
.attr = {.name = "image", .mode = 0200},
.size = MAX_IMAGE_SIZE, /* Limit image size */
.write = image_data_write,
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 330d566..f1fe172 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -70,7 +70,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
return count;
}
-static struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */
+static const struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */
.attr = {
.name = "hs_reg",
.mode = S_IRUGO | S_IWUSR,
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc: add const to bin_attribute structures
2017-08-02 18:07 [PATCH] powerpc: add const to bin_attribute structures Bhumika Goyal
@ 2017-08-18 12:50 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-08-18 12:50 UTC (permalink / raw)
To: Bhumika Goyal, julia.lawall, benh, paulus, linuxppc-dev, linux-kernel
Cc: Bhumika Goyal
On Wed, 2017-08-02 at 18:07:38 UTC, Bhumika Goyal wrote:
> Declare bin_attribute structures as const as they are only passed as an
> argument to the function sysfs_create_bin_file. This argument is of
> type const, so declare the structure as const.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8bfa42ab84910841336218265fcee9
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-18 12:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 18:07 [PATCH] powerpc: add const to bin_attribute structures Bhumika Goyal
2017-08-18 12:50 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.