net: Mac80211: Remove silly timespec dance
authorThomas Gleixner <tglx@linutronix.de>
Wed, 11 Jun 2014 23:59:18 +0000 (23:59 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Jun 2014 12:22:21 +0000 (14:22 +0200)
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>
net/mac80211/status.c
net/mac80211/tx.c

index ba29ebc8614121ea90ff5ff1cec44f137ac85a69..aa06dcad336e6d9bcdfff2009d7775b26bee8a6e 100644 (file)
@@ -473,8 +473,6 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
                                            struct sta_info *sta,
                                            struct ieee80211_hdr *hdr)
 {
-       ktime_t skb_dprt;
-       struct timespec dprt_time;
        u32 msrmnt;
        u16 tid;
        u8 *qc;
@@ -506,9 +504,8 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
 
        tx_lat = &sta->tx_lat[tid];
 
-       ktime_get_ts(&dprt_time); /* time stamp completion time */
-       skb_dprt = ktime_set(dprt_time.tv_sec, dprt_time.tv_nsec);
-       msrmnt = ktime_to_ms(ktime_sub(skb_dprt, skb_arv));
+       /* Calculate the latency */
+       msrmnt = ktime_to_ms(ktime_sub(ktime_get(), skb_arv));
 
        if (tx_lat->max < msrmnt) /* update stats */
                tx_lat->max = msrmnt;
index d741b7369dc4dfa1d522b5f7733a993437a5dae9..9b3d94e7c4be122b66f729d0b40f9b3d7fb1154d 100644 (file)
@@ -1770,15 +1770,12 @@ fail:
 static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local,
                                              struct sk_buff *skb)
 {
-       struct timespec skb_arv;
        struct ieee80211_tx_latency_bin_ranges *tx_latency;
 
        tx_latency = rcu_dereference(local->tx_latency);
        if (!tx_latency)
                return;
-
-       ktime_get_ts(&skb_arv);
-       skb->tstamp = ktime_set(skb_arv.tv_sec, skb_arv.tv_nsec);
+       skb->tstamp = ktime_get();
 }
 
 /**