diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-06-11 19:59:18 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-06-23 08:22:21 -0400 |
commit | 8d7b70fb7bf8963634052f455db86074d48bab2c (patch) | |
tree | e2429f096903e7e15b058fc2f6f63c8e533e127e /net | |
parent | 3283e286b859e9214867b2c855db065e41101b03 (diff) |
net: Mac80211: Remove silly timespec dance
Converting time from one format to another seems to give coders a warm
and fuzzy feeling.
Use the proper interfaces.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John W. Linville <linville@tuxdriver.com>
[fix compile error]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/status.c | 7 | ||||
-rw-r--r-- | net/mac80211/tx.c | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index ba29ebc86141..aa06dcad336e 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
@@ -473,8 +473,6 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local, | |||
473 | struct sta_info *sta, | 473 | struct sta_info *sta, |
474 | struct ieee80211_hdr *hdr) | 474 | struct ieee80211_hdr *hdr) |
475 | { | 475 | { |
476 | ktime_t skb_dprt; | ||
477 | struct timespec dprt_time; | ||
478 | u32 msrmnt; | 476 | u32 msrmnt; |
479 | u16 tid; | 477 | u16 tid; |
480 | u8 *qc; | 478 | u8 *qc; |
@@ -506,9 +504,8 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local, | |||
506 | 504 | ||
507 | tx_lat = &sta->tx_lat[tid]; | 505 | tx_lat = &sta->tx_lat[tid]; |
508 | 506 | ||
509 | ktime_get_ts(&dprt_time); /* time stamp completion time */ | 507 | /* Calculate the latency */ |
510 | skb_dprt = ktime_set(dprt_time.tv_sec, dprt_time.tv_nsec); | 508 | msrmnt = ktime_to_ms(ktime_sub(ktime_get(), skb_arv)); |
511 | msrmnt = ktime_to_ms(ktime_sub(skb_dprt, skb_arv)); | ||
512 | 509 | ||
513 | if (tx_lat->max < msrmnt) /* update stats */ | 510 | if (tx_lat->max < msrmnt) /* update stats */ |
514 | tx_lat->max = msrmnt; | 511 | tx_lat->max = msrmnt; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index d741b7369dc4..9b3d94e7c4be 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1770,15 +1770,12 @@ fail: | |||
1770 | static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local, | 1770 | static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local, |
1771 | struct sk_buff *skb) | 1771 | struct sk_buff *skb) |
1772 | { | 1772 | { |
1773 | struct timespec skb_arv; | ||
1774 | struct ieee80211_tx_latency_bin_ranges *tx_latency; | 1773 | struct ieee80211_tx_latency_bin_ranges *tx_latency; |
1775 | 1774 | ||
1776 | tx_latency = rcu_dereference(local->tx_latency); | 1775 | tx_latency = rcu_dereference(local->tx_latency); |
1777 | if (!tx_latency) | 1776 | if (!tx_latency) |
1778 | return; | 1777 | return; |
1779 | 1778 | skb->tstamp = ktime_get(); | |
1780 | ktime_get_ts(&skb_arv); | ||
1781 | skb->tstamp = ktime_set(skb_arv.tv_sec, skb_arv.tv_nsec); | ||
1782 | } | 1779 | } |
1783 | 1780 | ||
1784 | /** | 1781 | /** |