Skip to content

Commit 8d7b70f

Browse files
KAGA-KOKOjmberg-intel
authored andcommitted
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>
1 parent 3283e28 commit 8d7b70f

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

‎net/mac80211/status.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,6 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
473473
struct sta_info *sta,
474474
struct ieee80211_hdr *hdr)
475475
{
476-
ktime_t skb_dprt;
477-
struct timespec dprt_time;
478476
u32 msrmnt;
479477
u16 tid;
480478
u8 *qc;
@@ -506,9 +504,8 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
506504

507505
tx_lat = &sta->tx_lat[tid];
508506

509-
ktime_get_ts(&dprt_time); /* time stamp completion time */
510-
skb_dprt = ktime_set(dprt_time.tv_sec, dprt_time.tv_nsec);
511-
msrmnt = ktime_to_ms(ktime_sub(skb_dprt, skb_arv));
507+
/* Calculate the latency */
508+
msrmnt = ktime_to_ms(ktime_sub(ktime_get(), skb_arv));
512509

513510
if (tx_lat->max < msrmnt) /* update stats */
514511
tx_lat->max = msrmnt;

‎net/mac80211/tx.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,15 +1770,12 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
17701770
static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local,
17711771
struct sk_buff *skb)
17721772
{
1773-
struct timespec skb_arv;
17741773
struct ieee80211_tx_latency_bin_ranges *tx_latency;
17751774

17761775
tx_latency = rcu_dereference(local->tx_latency);
17771776
if (!tx_latency)
17781777
return;
1779-
1780-
ktime_get_ts(&skb_arv);
1781-
skb->tstamp = ktime_set(skb_arv.tv_sec, skb_arv.tv_nsec);
1778+
skb->tstamp = ktime_get();
17821779
}
17831780

17841781
/**

0 commit comments

Comments
 (0)