summaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe.h
diff options
context:
space:
mode:
authorAlexander Duyck2011-05-27 07:31:37 +0200
committerJeff Kirsher2011-06-25 09:04:32 +0200
commit7d4987de752a94772ad1ae85ad5c702bbcf73305 (patch)
tree136cd312e7d2582fc98e46d8be5b7f585ec0ee61 /drivers/net/ixgbe/ixgbe.h
parentixgbe: pass adapter struct instead of netdev for interrupt data (diff)
downloadkernel-qcow2-linux-7d4987de752a94772ad1ae85ad5c702bbcf73305.tar.gz
kernel-qcow2-linux-7d4987de752a94772ad1ae85ad5c702bbcf73305.tar.xz
kernel-qcow2-linux-7d4987de752a94772ad1ae85ad5c702bbcf73305.zip
ixgbe: Convert IXGBE_DESC_UNUSED from macro to static inline function
This change is a minor cleanup that converts the IXGBE_DESC_UNUSED macro into a static inline function just for the case of the code being a bit cleaner. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe.h')
-rw-r--r--drivers/net/ixgbe/ixgbe.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index d6bfb2f6ba86..b1d4b02606ae 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -306,9 +306,13 @@ struct ixgbe_q_vector {
((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8)
#define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG
-#define IXGBE_DESC_UNUSED(R) \
- ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
- (R)->next_to_clean - (R)->next_to_use - 1)
+static inline u16 ixgbe_desc_unused(struct ixgbe_ring *ring)
+{
+ u16 ntc = ring->next_to_clean;
+ u16 ntu = ring->next_to_use;
+
+ return ((ntc > ntu) ? 0 : ring->count) + ntc - ntu - 1;
+}
#define IXGBE_RX_DESC_ADV(R, i) \
(&(((union ixgbe_adv_rx_desc *)((R)->desc))[i]))