netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Ron Mercer <ron.mercer@qlogic.com>, netdev@vger.kernel.org
Cc: linux-driver@qlogic.com
Subject: [PATCH net-next] qlge: make nic_operations struct const
Date: Thu, 14 Apr 2011 08:51:52 -0700	[thread overview]
Message-ID: <20110414085152.042a79e4@nehalam> (raw)

The struct nic_operations is just function pointers and should be
declared const for added security.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/qlge/qlge.h	2011-04-14 08:31:15.863779054 -0700
+++ b/drivers/net/qlge/qlge.h	2011-04-14 08:31:19.231840948 -0700
@@ -2134,7 +2134,7 @@ struct ql_adapter {
 	struct delayed_work mpi_idc_work;
 	struct delayed_work mpi_core_to_log;
 	struct completion ide_completion;
-	struct nic_operations *nic_ops;
+	const struct nic_operations *nic_ops;
 	u16 device_id;
 	struct timer_list timer;
 	atomic_t lb_count;
--- a/drivers/net/qlge/qlge_main.c	2011-04-14 08:30:32.311185557 -0700
+++ b/drivers/net/qlge/qlge_main.c	2011-04-14 08:31:07.595627135 -0700
@@ -4412,12 +4412,12 @@ error:
 	rtnl_unlock();
 }
 
-static struct nic_operations qla8012_nic_ops = {
+static const struct nic_operations qla8012_nic_ops = {
 	.get_flash		= ql_get_8012_flash_params,
 	.port_initialize	= ql_8012_port_initialize,
 };
 
-static struct nic_operations qla8000_nic_ops = {
+static const struct nic_operations qla8000_nic_ops = {
 	.get_flash		= ql_get_8000_flash_params,
 	.port_initialize	= ql_8000_port_initialize,
 };

             reply	other threads:[~2011-04-14 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 15:51 Stephen Hemminger [this message]
2011-04-15  4:55 ` [PATCH net-next] qlge: make nic_operations struct const David Miller

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=20110414085152.042a79e4@nehalam \
    --to=shemminger@vyatta.com \
    --cc=linux-driver@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=ron.mercer@qlogic.com \
    /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).