powerpc: add const to bin_attribute structures
PATCH 1/1 powerpc: add const to bin_attribute structures
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 <[email protected]>
--- arch/powerpc/platforms/powernv/opal-flash.c | 2 +- arch/powerpc/sysdev/mv64x60_pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/opal-flash.c +1 -1
@@ -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,
arch/powerpc/sysdev/mv64x60_pci.c +1 -1
@@ -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 ,
Signature · 1 line
1.9.1
Michael Ellerman
AppliedQuoted 5 lines · Bhumika Goyal
Declare
bin_attributestructures as const as they are only passed as an argument to the functionsysfs_create_bin_file. This argument is of type const, so declare the structure as const.Signed-off-by Bhumika Goyal <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8bfa42ab84910841336218265fcee9
cheers