netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Mason <jon.mason@exar.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org,
	Sivakumar Subramani <sivakumar.subramani@exar.com>,
	Sreenivasa Honnur <sreenivasa.honnur@exar.com>,
	Ram Vepa <ram.vepa@exar.com>,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: [PATCH 2/4] s2io: make strings at tables const
Date: Fri, 10 Dec 2010 19:40:02 -0600	[thread overview]
Message-ID: <1292031604-16628-2-git-send-email-jon.mason@exar.com> (raw)
In-Reply-To: <1292031604-16628-1-git-send-email-jon.mason@exar.com>

Put immutable data in read/only section.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jon Mason <jon.mason@exar.com>
---
 drivers/net/s2io.c |    8 ++++----
 drivers/net/s2io.h |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index a6d3eaf..6a87b8c 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -91,11 +91,11 @@
 #define DRV_VERSION "2.0.26.27"
 
 /* S2io Driver name & version. */
-static char s2io_driver_name[] = "Neterion";
-static char s2io_driver_version[] = DRV_VERSION;
+static const char s2io_driver_name[] = "Neterion";
+static const char s2io_driver_version[] = DRV_VERSION;
 
-static int rxd_size[2] = {32, 48};
-static int rxd_count[2] = {127, 85};
+static const int rxd_size[2] = {32, 48};
+static const int rxd_count[2] = {127, 85};
 
 static inline int RXD_IS_UP2DT(struct RxD_t *rxdp)
 {
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 1671443..7d16030 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -360,7 +360,7 @@ struct stat_block {
 #define MAX_TX_DESC    (MAX_AVAILABLE_TXDS)
 
 /* FIFO mappings for all possible number of fifos configured */
-static int fifo_map[][MAX_TX_FIFOS] = {
+static const int fifo_map[][MAX_TX_FIFOS] = {
 	{0, 0, 0, 0, 0, 0, 0, 0},
 	{0, 0, 0, 0, 1, 1, 1, 1},
 	{0, 0, 0, 1, 1, 1, 2, 2},
@@ -371,7 +371,7 @@ static int fifo_map[][MAX_TX_FIFOS] = {
 	{0, 1, 2, 3, 4, 5, 6, 7},
 };
 
-static u16 fifo_selector[MAX_TX_FIFOS] = {0, 1, 3, 3, 7, 7, 7, 7};
+static const u16 fifo_selector[MAX_TX_FIFOS] = {0, 1, 3, 3, 7, 7, 7, 7};
 
 /* Maintains Per FIFO related information. */
 struct tx_fifo_config {
-- 
1.7.0.4


  reply	other threads:[~2010-12-11  1:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-11  1:40 [PATCH 1/4] s2io: rx_ring_sz bounds checking Jon Mason
2010-12-11  1:40 ` Jon Mason [this message]
2010-12-11 19:47   ` [PATCH 2/4] s2io: make strings at tables const David Miller
2010-12-11  1:40 ` [PATCH 3/4] s2io: Update Driver Version Jon Mason
2010-12-11 19:47   ` David Miller
2010-12-11  1:40 ` [PATCH 4/4] Using static const generally increases object text and decreases data size. It also generally decreases overall object size Jon Mason
2010-12-11 19:48   ` David Miller
2010-12-11 19:47 ` [PATCH 1/4] s2io: rx_ring_sz bounds checking 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=1292031604-16628-2-git-send-email-jon.mason@exar.com \
    --to=jon.mason@exar.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ram.vepa@exar.com \
    --cc=shemminger@vyatta.com \
    --cc=sivakumar.subramani@exar.com \
    --cc=sreenivasa.honnur@exar.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).