netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Jeff Garzik <jgarzik@pobox.com>,
	netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Cc: John Rociak <john.ronciak@intel.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>
Subject: [PATCH 03/11] ixgb: Fix hard coded numbers
Date: Fri, 21 Apr 2006 18:00:37 -0700	[thread overview]
Message-ID: <20060422010036.24255.25895.stgit@jk-desktop.jf.intel.com> (raw)
In-Reply-To: <20060422010016.24255.50772.stgit@jk-desktop.jf.intel.com>


- removed hard coded numbers and used constants instead

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_ethtool.c |    4 +++-
 drivers/net/ixgb/ixgb_main.c    |    8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index e8d83de..978be30 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -44,6 +44,8 @@ extern void ixgb_free_rx_resources(struc
 extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
 extern void ixgb_update_stats(struct ixgb_adapter *adapter);
 
+#define IXGB_ALL_RAR_ENTRIES 16
+
 struct ixgb_stats {
 	char stat_string[ETH_GSTRING_LEN];
 	int sizeof_stat;
@@ -317,7 +319,7 @@ ixgb_get_regs(struct net_device *netdev,
 	*reg++ = IXGB_READ_REG(hw, RXCSUM);	/*  20 */
 
 	/* there are 16 RAR entries in hardware, we only use 3 */
-	for(i = 0; i < 16; i++) {
+	for(i = 0; i < IXGB_ALL_RAR_ENTRIES; i++) {
 		*reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */
 		*reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */
 	}
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 6f8fd6f..f468d5d 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1227,11 +1227,11 @@ ixgb_tso(struct ixgb_adapter *adapter, s
 		if(++i == adapter->tx_ring.count) i = 0;
 		adapter->tx_ring.next_to_use = i;
 
-		return 1;
+		return TRUE;
 	}
 #endif
 
-	return 0;
+	return FALSE;
 }
 
 static inline boolean_t
@@ -1413,7 +1413,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 	if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
 		netif_stop_queue(netdev);
 		spin_unlock_irqrestore(&adapter->tx_lock, flags);
-		return 1;
+		return NETDEV_TX_BUSY;
 	}
 	spin_unlock_irqrestore(&adapter->tx_lock, flags);
 
@@ -1440,7 +1440,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 
 	netdev->trans_start = jiffies;
 
-	return 0;
+	return NETDEV_TX_OK;
 }
 
 /**


  parent reply	other threads:[~2006-04-22  0:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
2006-04-22  8:49   ` Francois Romieu
2006-04-22  1:00 ` [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk Jeff Kirsher
2006-04-22  9:03   ` Francois Romieu
2006-04-24 17:24     ` Stephen Hemminger
2006-05-19 18:35     ` Auke Kok
2006-04-22  1:00 ` Jeff Kirsher [this message]
2006-04-22  9:17   ` [PATCH 03/11] ixgb: Fix hard coded numbers Francois Romieu
2006-04-22  1:00 ` [PATCH 04/11] ixgb: Fix duplicate code Jeff Kirsher
2006-04-22  1:00 ` [PATCH 05/11] ixgb: Fix timeout code Jeff Kirsher
2006-04-22  1:00 ` [PATCH 06/11] ixgb: Fix TSO Jeff Kirsher
2006-04-22  1:00 ` [PATCH 07/11] ixgb: Fixed flow control parameters Jeff Kirsher
2006-04-22  1:00 ` [PATCH 08/11] ixgb: Add support for copper 10GbE Jeff Kirsher
2006-04-22  1:00 ` [PATCH 09/11] ixgb: Add performance enhancements to the buffer_info struct Jeff Kirsher
2006-04-22  1:00 ` [PATCH 10/11] ixgb: clean up whitespace Jeff Kirsher
2006-04-22  1:00 ` [PATCH 11/11] ixgb: Add prefetch Jeff Kirsher
2006-04-22  5:34   ` Eric Dumazet
2006-04-26 10:22 ` [PATCH 00/11] ixgb: driver update (upstream) Jeff Garzik

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=20060422010036.24255.25895.stgit@jk-desktop.jf.intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jesse.brandeburg@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=john.ronciak@intel.com \
    --cc=netdev@vger.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).