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>, Joe Perches <joe@perches.com>
Subject: [PATCH 4/4] Using static const generally increases object text and decreases data size. It also generally decreases overall object size.
Date: Fri, 10 Dec 2010 19:40:04 -0600 [thread overview]
Message-ID: <1292031604-16628-4-git-send-email-jon.mason@exar.com> (raw)
In-Reply-To: <1292031604-16628-1-git-send-email-jon.mason@exar.com>
text data bss dec hex filename
109387 389 24432 134208 20c40 drivers/net/s2io.o.old
109358 389 24432 134179 20c23 drivers/net/s2io.o.new
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jon Mason <jon.mason@exar.com>
---
drivers/net/s2io.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 80efc05..9a1e32f 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3598,10 +3598,12 @@ static int s2io_set_swapper(struct s2io_nic *sp)
val64 = readq(&bar0->pif_rd_swapper_fb);
if (val64 != 0x0123456789ABCDEFULL) {
int i = 0;
- u64 value[] = { 0xC30000C3C30000C3ULL, /* FE=1, SE=1 */
- 0x8100008181000081ULL, /* FE=1, SE=0 */
- 0x4200004242000042ULL, /* FE=0, SE=1 */
- 0}; /* FE=0, SE=0 */
+ static const u64 value[] = {
+ 0xC30000C3C30000C3ULL, /* FE=1, SE=1 */
+ 0x8100008181000081ULL, /* FE=1, SE=0 */
+ 0x4200004242000042ULL, /* FE=0, SE=1 */
+ 0 /* FE=0, SE=0 */
+ };
while (i < 4) {
writeq(value[i], &bar0->swapper_ctrl);
@@ -3627,10 +3629,12 @@ static int s2io_set_swapper(struct s2io_nic *sp)
if (val64 != valt) {
int i = 0;
- u64 value[] = { 0x00C3C30000C3C300ULL, /* FE=1, SE=1 */
- 0x0081810000818100ULL, /* FE=1, SE=0 */
- 0x0042420000424200ULL, /* FE=0, SE=1 */
- 0}; /* FE=0, SE=0 */
+ static const u64 value[] = {
+ 0x00C3C30000C3C300ULL, /* FE=1, SE=1 */
+ 0x0081810000818100ULL, /* FE=1, SE=0 */
+ 0x0042420000424200ULL, /* FE=0, SE=1 */
+ 0 /* FE=0, SE=0 */
+ };
while (i < 4) {
writeq((value[i] | valr), &bar0->swapper_ctrl);
--
1.7.0.4
next prev parent 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 ` [PATCH 2/4] s2io: make strings at tables const Jon Mason
2010-12-11 19:47 ` 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 ` Jon Mason [this message]
2010-12-11 19:48 ` [PATCH 4/4] Using static const generally increases object text and decreases data size. It also generally decreases overall object size 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-4-git-send-email-jon.mason@exar.com \
--to=jon.mason@exar.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=ram.vepa@exar.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).