From 93dee8eea02aefebe2d21128b5f742afe6671f23 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 Aug 2015 20:28:32 -0700 Subject: [PATCH] staging: wilc1000: remove WILC_TimerCreate() It was just a wrapper around setup_timer() and could never fail, so just call the real function, and fix up the function arguments of the callbacks to be proper timer callback functions. Cc: Johnny Kim Cc: Rachel Kim Cc: Dean Lee Cc: Chris Park Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/host_interface.c | 42 ++++++------------- drivers/staging/wilc1000/wilc_timer.c | 9 ---- .../staging/wilc1000/wilc_wfi_cfgoperations.c | 10 ++--- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 887aec27192f..bab53195edfb 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3978,11 +3978,11 @@ _done_: * @date * @version 1.0 */ -static void ListenTimerCB(void *pvArg) +static void ListenTimerCB(unsigned long arg) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg; + tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg; /*Stopping remain-on-channel timer*/ del_timer(&pstrWFIDrv->hRemainOnChannel); @@ -4542,8 +4542,9 @@ static int hostIFthread(void *pvArg) return 0; } -static void TimerCB_Scan(void *pvArg) +static void TimerCB_Scan(unsigned long arg) { + void *pvArg = (void *)arg; tstrHostIFmsg strHostIFmsg; /* prepare the Timer Callback message */ @@ -4555,8 +4556,9 @@ static void TimerCB_Scan(void *pvArg) WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL); } -static void TimerCB_Connect(void *pvArg) +static void TimerCB_Connect(unsigned long arg) { + void *pvArg = (void *)arg; tstrHostIFmsg strHostIFmsg; /* prepare the Timer Callback message */ @@ -6415,9 +6417,9 @@ void host_int_send_join_leave_info_to_host * @version 1.0 */ -void GetPeriodicRSSI(void *pvArg) +static void GetPeriodicRSSI(unsigned long arg) { - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg; + tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg; if (pstrWFIDrv == NULL) { PRINT_ER("Driver handler is NULL\n"); @@ -6537,36 +6539,19 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv) s32Error = WILC_FAIL; goto _fail_mq_; } - s32Error = WILC_TimerCreate(&(g_hPeriodicRSSI), GetPeriodicRSSI); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_timer_1; - } + setup_timer(&g_hPeriodicRSSI, GetPeriodicRSSI, 0); WILC_TimerStart(&(g_hPeriodicRSSI), 5000, (void *)pstrWFIDrv); } - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hScanTimer), TimerCB_Scan); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_thread_; - } - - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hConnectTimer), TimerCB_Connect); - if (s32Error < 0) { - PRINT_ER("Failed to creat Timer\n"); - goto _fail_timer_1; - } + setup_timer(&pstrWFIDrv->hScanTimer, TimerCB_Scan, 0); + setup_timer(&pstrWFIDrv->hConnectTimer, TimerCB_Connect, 0); #ifdef WILC_P2P /*Remain on channel timer*/ - s32Error = WILC_TimerCreate(&(pstrWFIDrv->hRemainOnChannel), ListenTimerCB); - if (s32Error < 0) { - PRINT_ER("Failed to creat Remain-on-channel Timer\n"); - goto _fail_timer_3; - } + setup_timer(&pstrWFIDrv->hRemainOnChannel, ListenTimerCB, 0); #endif sema_init(&(pstrWFIDrv->gtOsCfgValuesSem), 1); @@ -6617,15 +6602,12 @@ _fail_mem_: if (pstrWFIDrv != NULL) kfree(pstrWFIDrv); #ifdef WILC_P2P -_fail_timer_3: del_timer_sync(&pstrWFIDrv->hRemainOnChannel); #endif _fail_timer_2: up(&(pstrWFIDrv->gtOsCfgValuesSem)); del_timer_sync(&pstrWFIDrv->hConnectTimer); -_fail_timer_1: del_timer_sync(&pstrWFIDrv->hScanTimer); -_fail_thread_: kthread_stop(HostIFthreadHandler); _fail_mq_: WILC_MsgQueueDestroy(&gMsgQHostIF, NULL); diff --git a/drivers/staging/wilc1000/wilc_timer.c b/drivers/staging/wilc1000/wilc_timer.c index 49e3419d7114..775e38bda944 100644 --- a/drivers/staging/wilc1000/wilc_timer.c +++ b/drivers/staging/wilc1000/wilc_timer.c @@ -1,15 +1,6 @@ #include "wilc_timer.h" -WILC_ErrNo WILC_TimerCreate(struct timer_list *pHandle, - tpfWILC_TimerFunction pfCallback) -{ - WILC_ErrNo s32RetStatus = WILC_SUCCESS; - setup_timer(pHandle, (void(*)(unsigned long))pfCallback, 0); - - return s32RetStatus; -} - WILC_ErrNo WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout, void *pvArg) { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index b29ea90da56f..c2f8d605c176 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -231,7 +231,7 @@ void update_scan_time(void *pUserVoid) } } -void remove_network_from_shadow(void *pUserVoid) +static void remove_network_from_shadow(unsigned long arg) { unsigned long now = jiffies; int i, j; @@ -257,13 +257,13 @@ void remove_network_from_shadow(void *pUserVoid) PRINT_D(CFG80211_DBG, "Number of cached networks: %d\n", u32LastScannedNtwrksCountShadow); if (u32LastScannedNtwrksCountShadow != 0) - WILC_TimerStart(&(hAgingTimer), AGING_TIME, pUserVoid); + WILC_TimerStart(&(hAgingTimer), AGING_TIME, (void *)arg); else PRINT_D(CFG80211_DBG, "No need to restart Aging timer\n"); } #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP -void clear_duringIP(void *pUserVoid) +static void clear_duringIP(unsigned long arg) { PRINT_D(GENERIC_DBG, "GO:IP Obtained , enable scan\n"); g_obtainingIP = false; @@ -3824,9 +3824,9 @@ int WILC_WFI_InitHostInt(struct net_device *net) PRINT_D(INIT_DBG, "Host[%p][%p]\n", net, net->ieee80211_ptr); priv = wdev_priv(net->ieee80211_ptr); if (op_ifcs == 0) { - s32Error = WILC_TimerCreate(&(hAgingTimer), remove_network_from_shadow); + setup_timer(&hAgingTimer, remove_network_from_shadow, 0); #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP - s32Error = WILC_TimerCreate(&(hDuringIpTimer), clear_duringIP); + setup_timer(&hDuringIpTimer, clear_duringIP, 0); #endif } op_ifcs++; -- 2.20.1