Skip to content

Commit da6817e

Browse files
goyalbhumikadavem330
authored andcommitted
qlogic: make device_attribute const
Make these const as they are only passed as an argument to the function device_create_file and device_remove_file and the corresponding arguments are of type const. Done using Coccinelle Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a43dce9 commit da6817e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,7 +2828,7 @@ netxen_show_bridged_mode(struct device *dev,
28282828
return sprintf(buf, "%d\n", bridged_mode);
28292829
}
28302830

2831-
static struct device_attribute dev_attr_bridged_mode = {
2831+
static const struct device_attribute dev_attr_bridged_mode = {
28322832
.attr = {.name = "bridged_mode", .mode = (S_IRUGO | S_IWUSR)},
28332833
.show = netxen_show_bridged_mode,
28342834
.store = netxen_store_bridged_mode,
@@ -2860,7 +2860,7 @@ netxen_show_diag_mode(struct device *dev,
28602860
!!(adapter->flags & NETXEN_NIC_DIAG_ENABLED));
28612861
}
28622862

2863-
static struct device_attribute dev_attr_diag_mode = {
2863+
static const struct device_attribute dev_attr_diag_mode = {
28642864
.attr = {.name = "diag_mode", .mode = (S_IRUGO | S_IWUSR)},
28652865
.show = netxen_show_diag_mode,
28662866
.store = netxen_store_diag_mode,

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,19 +1174,19 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp,
11741174
return size;
11751175
}
11761176

1177-
static struct device_attribute dev_attr_bridged_mode = {
1177+
static const struct device_attribute dev_attr_bridged_mode = {
11781178
.attr = {.name = "bridged_mode", .mode = (S_IRUGO | S_IWUSR)},
11791179
.show = qlcnic_show_bridged_mode,
11801180
.store = qlcnic_store_bridged_mode,
11811181
};
11821182

1183-
static struct device_attribute dev_attr_diag_mode = {
1183+
static const struct device_attribute dev_attr_diag_mode = {
11841184
.attr = {.name = "diag_mode", .mode = (S_IRUGO | S_IWUSR)},
11851185
.show = qlcnic_show_diag_mode,
11861186
.store = qlcnic_store_diag_mode,
11871187
};
11881188

1189-
static struct device_attribute dev_attr_beacon = {
1189+
static const struct device_attribute dev_attr_beacon = {
11901190
.attr = {.name = "beacon", .mode = (S_IRUGO | S_IWUSR)},
11911191
.show = qlcnic_show_beacon,
11921192
.store = qlcnic_store_beacon,

0 commit comments

Comments
 (0)