summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e/rtl819x_TSProc.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-16 16:24:50 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-18 15:44:39 +0200
commit96bc1f2ae0171d1a24a5cedf6a0b0de8d1e8c406 (patch)
tree581ea46c0618f0e95662f4f95bbcbab5c850f1da /drivers/staging/rtl8192e/rtl819x_TSProc.c
parentd2e5af14fc8e70e76a0dfbb91d910ef74bb0eead (diff)
downloadop-kernel-dev-96bc1f2ae0171d1a24a5cedf6a0b0de8d1e8c406.zip
op-kernel-dev-96bc1f2ae0171d1a24a5cedf6a0b0de8d1e8c406.tar.gz
staging: rtl8192e: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Derek Robson <robsonde@gmail.com> Cc: Suniel Mahesh <suniel.spartan@gmail.com> Cc: Malcolm Priestley <tvboxspy@gmail.com> Cc: Gargi Sharma <gs051095@gmail.com> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Cc: "David S. Miller" <davem@davemloft.net> Cc: Johannes Berg <johannes.berg@intel.com> Cc: Yamanappagouda Patil <goudapatilk@gmail.com> Cc: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Cc: Colin Ian King <colin.king@canonical.com> Cc: Baoyou Xie <baoyou.xie@linaro.org> Cc: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Derek Robson <robsonde@gmail.com> Cc: Suniel Mahesh <suniel.spartan@gmail.com> Cc: Malcolm Priestley <tvboxspy@gmail.com> Cc: Gargi Sharma <gs051095@gmail.com> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Cc: Yamanappagouda Patil <goudapatilk@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Johannes Berg <johannes.berg@intel.com> Cc: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Cc: Colin Ian King <colin.king@canonical.com> Cc: Baoyou Xie <baoyou.xie@linaro.org> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtl819x_TSProc.c')
-rw-r--r--drivers/staging/rtl8192e/rtl819x_TSProc.c56
1 files changed, 23 insertions, 33 deletions
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index dcc4eb6..f839d24 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -16,17 +16,18 @@
#include <linux/etherdevice.h>
#include "rtl819x_TS.h"
-static void TsSetupTimeOut(unsigned long data)
+static void TsSetupTimeOut(struct timer_list *unused)
{
}
-static void TsInactTimeout(unsigned long data)
+static void TsInactTimeout(struct timer_list *unused)
{
}
-static void RxPktPendingTimeout(unsigned long data)
+static void RxPktPendingTimeout(struct timer_list *t)
{
- struct rx_ts_record *pRxTs = (struct rx_ts_record *)data;
+ struct rx_ts_record *pRxTs = from_timer(pRxTs, t,
+ RxPktPendingTimer);
struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device,
RxTsRecord[pRxTs->num]);
@@ -96,9 +97,9 @@ static void RxPktPendingTimeout(unsigned long data)
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
}
-static void TsAddBaProcess(unsigned long data)
+static void TsAddBaProcess(struct timer_list *t)
{
- struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
+ struct tx_ts_record *pTxTs = from_timer(pTxTs, t, TsAddBaTimer);
u8 num = pTxTs->num;
struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device,
TxTsRecord[num]);
@@ -150,24 +151,18 @@ void TSInitialize(struct rtllib_device *ieee)
for (count = 0; count < TOTAL_TS_NUM; count++) {
pTxTS->num = count;
- setup_timer(&pTxTS->TsCommonInfo.SetupTimer,
- TsSetupTimeOut,
- (unsigned long) pTxTS);
+ timer_setup(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut,
+ 0);
- setup_timer(&pTxTS->TsCommonInfo.InactTimer,
- TsInactTimeout,
- (unsigned long) pTxTS);
+ timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout,
+ 0);
- setup_timer(&pTxTS->TsAddBaTimer,
- TsAddBaProcess,
- (unsigned long) pTxTS);
+ timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0);
- setup_timer(&pTxTS->TxPendingBARecord.Timer,
- BaSetupTimeOut,
- (unsigned long) pTxTS);
- setup_timer(&pTxTS->TxAdmittedBARecord.Timer,
- TxBaInactTimeout,
- (unsigned long) pTxTS);
+ timer_setup(&pTxTS->TxPendingBARecord.Timer, BaSetupTimeOut,
+ 0);
+ timer_setup(&pTxTS->TxAdmittedBARecord.Timer,
+ TxBaInactTimeout, 0);
ResetTxTsEntry(pTxTS);
list_add_tail(&pTxTS->TsCommonInfo.List,
@@ -182,21 +177,16 @@ void TSInitialize(struct rtllib_device *ieee)
pRxTS->num = count;
INIT_LIST_HEAD(&pRxTS->RxPendingPktList);
- setup_timer(&pRxTS->TsCommonInfo.SetupTimer,
- TsSetupTimeOut,
- (unsigned long) pRxTS);
+ timer_setup(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut,
+ 0);
- setup_timer(&pRxTS->TsCommonInfo.InactTimer,
- TsInactTimeout,
- (unsigned long) pRxTS);
+ timer_setup(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout,
+ 0);
- setup_timer(&pRxTS->RxAdmittedBARecord.Timer,
- RxBaInactTimeout,
- (unsigned long) pRxTS);
+ timer_setup(&pRxTS->RxAdmittedBARecord.Timer,
+ RxBaInactTimeout, 0);
- setup_timer(&pRxTS->RxPktPendingTimer,
- RxPktPendingTimeout,
- (unsigned long) pRxTS);
+ timer_setup(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, 0);
ResetRxTsEntry(pRxTS);
list_add_tail(&pRxTS->TsCommonInfo.List,
OpenPOWER on IntegriCloud