netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bhumika Goyal <bhumirks@gmail.com>
To: julia.lawall@lip6.fr, rjw@rjwysocki.net, lenb@kernel.org,
	jbacik@fb.com, jikos@kernel.org, benjamin.tissoires@redhat.com,
	manish.chopra@cavium.com, rahul.verma@cavium.com,
	Dept-GELinuxNICDev@cavium.com, harish.patil@cavium.com,
	cascardo@holoscopio.com, don@syst.com.br, dvhart@infradead.org,
	andy@infradead.org, sre@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	nbd-general@lists.sourceforge.net, linux-input@vger.kernel.org,
	netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-pm@vger.kernel.org
Cc: Bhumika Goyal <bhumirks@gmail.com>
Subject: [PATCH 4/6] qlogic:  make device_attribute const
Date: Mon, 21 Aug 2017 17:13:10 +0530	[thread overview]
Message-ID: <1503315792-14837-5-git-send-email-bhumirks@gmail.com> (raw)
In-Reply-To: <1503315792-14837-1-git-send-email-bhumirks@gmail.com>

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

  parent reply	other threads:[~2017-08-21 11:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 11:43 [PATCH 0/6] drivers: make device_attribute const Bhumika Goyal
2017-08-21 11:43 ` [PATCH 1/6] ACPI: " Bhumika Goyal
2017-08-28 20:56   ` Rafael J. Wysocki
     [not found] ` <1503315792-14837-1-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-21 11:43   ` [PATCH 2/6] nbd: " Bhumika Goyal
2017-08-28 21:21     ` Jens Axboe
2017-08-21 11:43 ` [PATCH 3/6] hid: " Bhumika Goyal
2017-09-06  8:57   ` Jiri Kosina
2017-08-21 11:43 ` Bhumika Goyal [this message]
2017-08-21 17:25   ` [PATCH 4/6] qlogic: " David Miller
2017-08-21 17:26     ` Bhumika Goyal
2017-08-21 11:43 ` [PATCH 5/6] platform/x86: " Bhumika Goyal
2017-08-21 13:22   ` Thadeu Lima de Souza Cascardo
2017-08-30 19:18   ` Andy Shevchenko
2017-08-21 11:43 ` [PATCH 6/6] power: supply: " Bhumika Goyal
2017-08-29  8:44   ` Sebastian Reichel
2017-08-21 12:28 ` [PATCH 0/6] drivers: " Rafael J. Wysocki
2017-08-21 12:57   ` Bhumika Goyal
2017-08-21 12:55 ` Bhumika Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503315792-14837-5-git-send-email-bhumirks@gmail.com \
    --to=bhumirks@gmail.com \
    --cc=Dept-GELinuxNICDev@cavium.com \
    --cc=andy@infradead.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=cascardo@holoscopio.com \
    --cc=don@syst.com.br \
    --cc=dvhart@infradead.org \
    --cc=harish.patil@cavium.com \
    --cc=jbacik@fb.com \
    --cc=jikos@kernel.org \
    --cc=julia.lawall@lip6.fr \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=manish.chopra@cavium.com \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rahul.verma@cavium.com \
    --cc=rjw@rjwysocki.net \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).