From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Stultz <john.stultz@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Subject: [patch 12/13] net: mac80211: Remove silly timespec dance
Date: Wed, 11 Jun 2014 23:59:18 -0000 [thread overview]
Message-ID: <20140611234607.683770899@linutronix.de> (raw)
In-Reply-To: 20140611234024.103571777@linutronix.de
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: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
---
net/mac80211/status.c | 7 ++-----
net/mac80211/tx.c | 5 +----
2 files changed, 3 insertions(+), 9 deletions(-)
Index: linux/net/mac80211/status.c
===================================================================
--- linux.orig/net/mac80211/status.c
+++ linux/net/mac80211/status.c
@@ -473,8 +473,6 @@ static void ieee80211_tx_latency_end_msr
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_msr
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(net_timedelta(skb_arv));
if (tx_lat->max < msrmnt) /* update stats */
tx_lat->max = msrmnt;
Index: linux/net/mac80211/tx.c
===================================================================
--- linux.orig/net/mac80211/tx.c
+++ linux/net/mac80211/tx.c
@@ -1767,15 +1767,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);
+ __net_timestamp(skb);
}
/**
next prev parent reply other threads:[~2014-06-11 23:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140611234024.103571777@linutronix.de>
2014-06-11 23:59 ` [patch 04/13] net: mac80211: Use ktime_get_ts() Thomas Gleixner
2014-06-12 6:53 ` Johannes Berg
2014-06-12 9:03 ` Luis R. Rodriguez
2014-06-12 9:51 ` [Cocci] " Julia.Lawall
2014-06-12 10:49 ` Thomas Gleixner
2014-06-11 23:59 ` Thomas Gleixner [this message]
2014-06-12 6:49 ` [patch 12/13] net: mac80211: Remove silly timespec dance Johannes Berg
2014-06-12 8:19 ` Thomas Gleixner
2014-06-12 8:35 ` net_timedelta() affected by settimeofday() (was: [patch 12/13] net: mac80211: Remove silly timespec dance) Johannes Berg
2014-06-12 8:39 ` Johannes Berg
2014-06-12 8:57 ` Thomas Gleixner
2014-06-12 9:21 ` Johannes Berg
2014-06-12 14:09 ` Thomas Gleixner
2014-06-13 17:58 ` Johannes Berg
2014-06-11 23:59 ` [patch 11/13] wireless: mwifiex: Use the proper interfaces Thomas Gleixner
2014-06-12 3:22 ` Bing Zhao
2014-06-12 8:31 ` [patch V2] " Thomas Gleixner
2014-06-12 8:38 ` Johannes Berg
2014-06-13 18:28 ` Bing Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140611234607.683770899@linutronix.de \
--to=tglx@linutronix.de \
--cc=johannes@sipsolutions.net \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).