Skip to contentSkip to conversation

scsi: esas2r: make bin_attr_default_nvram const

PATCH New Bhumika Goyal 1 participant 1 message Sep 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: esas2r: make bin_attr_default_nvram const

Make this const as it is only passed to the const arguments of the functions sysfs_remove_bin_file and sysfs_create_bin_file. Make the declaration const too.

Structure found using Coccinelle and changes done by hand.

---
 drivers/scsi/esas2r/esas2r.h      | 2 +-
 drivers/scsi/esas2r/esas2r_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/esas2r/esas2r.h +1 -1
index 1da6407..f9acf54 100644
@@ -1421,6 +1421,6 @@ static inline void esas2r_comp_list_drain(struct esas2r_adapter *a,
 extern struct bin_attribute bin_attr_vda;
 extern struct bin_attribute bin_attr_hw;
 extern struct bin_attribute bin_attr_live_nvram;
-extern struct bin_attribute bin_attr_default_nvram;
+extern const struct bin_attribute bin_attr_default_nvram;
 
 #endif /* ESAS2R_H */
drivers/scsi/esas2r/esas2r_main.c +1 -1
index 81f226b..9291768 100644
@@ -224,7 +224,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj,
 ESAS2R_RW_BIN_ATTR(hw);
 ESAS2R_RW_BIN_ATTR(live_nvram);
 
-struct bin_attribute bin_attr_default_nvram = {
+const struct bin_attribute bin_attr_default_nvram = {
 	.attr	= { .name = "default_nvram", .mode = S_IRUGO },
 	.size	= 0,
 	.read	= read_default_nvram,
Signature · 1 line
1.9.1