Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236202

[PATCH 04/12] mwifiex: use ktime_get_real for timestamping

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH 04/12] mwifiex: use ktime_get_real for timestamping
Date 2015-09-30 13:40 +0200
Message-ID <qenTQ-3J6-33@gated-at.bofh.it> (permalink)
References <qenKa-3xS-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The mwifiex_11n_aggregate_pkt() function creates a ktime_t from
a timeval returned by do_gettimeofday, which is slow and causes
an overflow in 2038 on 32-bit architectures.

This solves both problems by using the appropriate ktime_get_real()
function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Amitkumar Karwar <akarwar@marvell.com>
Cc: Nishant Sarmukadam <nishants@marvell.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
---
 drivers/net/wireless/mwifiex/11n_aggr.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index f7c717253a66..78853c51774d 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -173,7 +173,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
 	int pad = 0, aggr_num = 0, ret;
 	struct mwifiex_tx_param tx_param;
 	struct txpd *ptx_pd = NULL;
-	struct timeval tv;
 	int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN;
 
 	skb_src = skb_peek(&pra_list->skb_head);
@@ -203,8 +202,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
 	tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_AGGR_PKT;
 	skb_aggr->priority = skb_src->priority;
 
-	do_gettimeofday(&tv);
-	skb_aggr->tstamp = timeval_to_ktime(tv);
+	skb_aggr->tstamp = ktime_get_real();
 
 	do {
 		/* Check if AMSDU can accommodate this MSDU */
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/12] net: assorted y2038 changes Arnd Bergmann <arnd@arndb.de> - 2015-09-30 13:40 +0200
  [PATCH 03/12] net: igb: avoid using timespec Arnd Bergmann <arnd@arndb.de> - 2015-09-30 13:40 +0200
    Re: [PATCH 03/12] net: igb: avoid using timespec Richard Cochran <richardcochran@gmail.com> - 2015-10-01 21:20 +0200
      Re: [PATCH 03/12] net: igb: avoid using timespec Arnd Bergmann <arnd@arndb.de> - 2015-10-01 22:10 +0200
        Re: [PATCH 03/12] net: igb: avoid using timespec Richard Cochran <richardcochran@gmail.com> - 2015-10-02 09:50 +0200
  [PATCH 02/12] net: stmmac: avoid using timespec Arnd Bergmann <arnd@arndb.de> - 2015-09-30 13:40 +0200
    Re: [PATCH 02/12] net: stmmac: avoid using timespec Richard Cochran <richardcochran@gmail.com> - 2015-10-01 21:10 +0200
  [PATCH 04/12] mwifiex: use ktime_get_real for timestamping Arnd Bergmann <arnd@arndb.de> - 2015-09-30 13:40 +0200
  Re: [PATCH 00/12] net: assorted y2038 changes David Miller <davem@davemloft.net> - 2015-10-05 12:10 +0200

csiph-web