aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2008-01-24 15:47:39 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:47 -0500
commit9e7d1a445ed0d5c1d8863945d6c4c6f018a4aa83 (patch)
tree57ea08c17f64dcb8c42b9a94793313e412d3a023 /drivers/net/wireless/iwlwifi/iwl-helpers.h
parent303d9bf6bb64ead8e3f1d7e29904a4025502e591 (diff)
iwlwifi: correct math in elapsed_jiffies
w/o the first change: if end == start you get MAX_JIFFY_OFFSET which isn't what you want... For the latter I think to be technically correct you need the +1 to account for the jiffy between MAX_JIFFY_OFFSET and 0 (hmm w/ the 2nd change the first isn't strictly needed... ah well) Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index cd2eb1848310..cb009f4c401f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -246,10 +246,10 @@ static inline int iwl_check_bits(unsigned long field, unsigned long mask)
246static inline unsigned long elapsed_jiffies(unsigned long start, 246static inline unsigned long elapsed_jiffies(unsigned long start,
247 unsigned long end) 247 unsigned long end)
248{ 248{
249 if (end > start) 249 if (end >= start)
250 return end - start; 250 return end - start;
251 251
252 return end + (MAX_JIFFY_OFFSET - start); 252 return end + (MAX_JIFFY_OFFSET - start) + 1;
253} 253}
254 254
255static inline u8 iwl_get_dma_hi_address(dma_addr_t addr) 255static inline u8 iwl_get_dma_hi_address(dma_addr_t addr)