Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716367

[PATCH 4/6] qlogic: make device_attribute const

From Bhumika Goyal <bhumirks@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 4/6] qlogic: make device_attribute const
Date 2017-08-21 13:50 +0200
Message-ID <ugTnt-3Rl-39@gated-at.bofh.it> (permalink)
References <ugTnr-3Rl-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 ++--
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 827de83..f2e8de6 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2828,7 +2828,7 @@ static void netxen_nic_poll_controller(struct net_device *netdev)
 	return sprintf(buf, "%d\n", bridged_mode);
 }
 
-static struct device_attribute dev_attr_bridged_mode = {
+static const struct device_attribute dev_attr_bridged_mode = {
        .attr = {.name = "bridged_mode", .mode = (S_IRUGO | S_IWUSR)},
        .show = netxen_show_bridged_mode,
        .store = netxen_store_bridged_mode,
@@ -2860,7 +2860,7 @@ static void netxen_nic_poll_controller(struct net_device *netdev)
 			!!(adapter->flags & NETXEN_NIC_DIAG_ENABLED));
 }
 
-static struct device_attribute dev_attr_diag_mode = {
+static const struct device_attribute dev_attr_diag_mode = {
 	.attr = {.name = "diag_mode", .mode = (S_IRUGO | S_IWUSR)},
 	.show = netxen_show_diag_mode,
 	.store = netxen_store_diag_mode,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
index 82fcb83..287d89d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
@@ -1174,19 +1174,19 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp,
 	return size;
 }
 
-static struct device_attribute dev_attr_bridged_mode = {
+static const struct device_attribute dev_attr_bridged_mode = {
        .attr = {.name = "bridged_mode", .mode = (S_IRUGO | S_IWUSR)},
        .show = qlcnic_show_bridged_mode,
        .store = qlcnic_store_bridged_mode,
 };
 
-static struct device_attribute dev_attr_diag_mode = {
+static const struct device_attribute dev_attr_diag_mode = {
 	.attr = {.name = "diag_mode", .mode = (S_IRUGO | S_IWUSR)},
 	.show = qlcnic_show_diag_mode,
 	.store = qlcnic_store_diag_mode,
 };
 
-static struct device_attribute dev_attr_beacon = {
+static const struct device_attribute dev_attr_beacon = {
 	.attr = {.name = "beacon", .mode = (S_IRUGO | S_IWUSR)},
 	.show = qlcnic_show_beacon,
 	.store = qlcnic_store_beacon,
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] drivers:  make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 2/6] nbd: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 3/6] hid: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 4/6] qlogic:  make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
    Re: [PATCH 4/6] qlogic: make device_attribute const David Miller <davem@davemloft.net> - 2017-08-21 19:30 +0200
      Re: [PATCH 4/6] qlogic: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 19:30 +0200
  Re: [PATCH 0/6] drivers: make device_attribute const "Rafael J. Wysocki" <rafael@kernel.org> - 2017-08-21 14:30 +0200
    Re: [PATCH 0/6] drivers: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 15:00 +0200
  Re: [PATCH 0/6] drivers: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 15:00 +0200

csiph-web