staging: wilc1000: remove unnecessary void pointer cast
[deliverable/linux.git] / drivers / staging / wilc1000 / wilc_wfi_cfgoperations.c
index b29ea90da56f4eb60db7d2140c9dfd39529d008f..a6edc973f636babacc4fd8f51956bd197958610e 100644 (file)
@@ -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;
@@ -256,14 +256,16 @@ 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);
-       else
+       if (u32LastScannedNtwrksCountShadow != 0) {
+               hAgingTimer.data = arg;
+               mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
+       } 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;
@@ -277,7 +279,8 @@ int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 
        if (u32LastScannedNtwrksCountShadow == 0) {
                PRINT_D(CFG80211_DBG, "Starting Aging timer\n");
-               WILC_TimerStart(&(hAgingTimer), AGING_TIME, pUserVoid);
+               hAgingTimer.data = (unsigned long)pUserVoid;
+               mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
                state = -1;
        } else {
                /* Linear search for now */
@@ -336,7 +339,7 @@ void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, vo
        if (ap_found != -1)
                kfree(astrLastScannedNtwrksShadow[ap_index].pu8IEs);
        astrLastScannedNtwrksShadow[ap_index].pu8IEs =
-               (u8 *)WILC_MALLOC(pstrNetworkInfo->u16IEsLen);        /* will be deallocated by the WILC_WFI_CfgScan() function */
+               WILC_MALLOC(pstrNetworkInfo->u16IEsLen);        /* will be deallocated by the WILC_WFI_CfgScan() function */
        memcpy(astrLastScannedNtwrksShadow[ap_index].pu8IEs,
                    pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen);
 
@@ -1190,13 +1193,13 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
                if (priv->wdev->iftype == NL80211_IFTYPE_AP || priv->wdev->iftype == NL80211_IFTYPE_P2P_GO) {
 
                        if (priv->wilc_gtk[key_index] == NULL) {
-                               priv->wilc_gtk[key_index] = (struct wilc_wfi_key *)WILC_MALLOC(sizeof(struct wilc_wfi_key));
+                               priv->wilc_gtk[key_index] = WILC_MALLOC(sizeof(struct wilc_wfi_key));
                                priv->wilc_gtk[key_index]->key = NULL;
                                priv->wilc_gtk[key_index]->seq = NULL;
 
                        }
                        if (priv->wilc_ptk[key_index] == NULL) {
-                               priv->wilc_ptk[key_index] = (struct wilc_wfi_key *)WILC_MALLOC(sizeof(struct wilc_wfi_key));
+                               priv->wilc_ptk[key_index] = WILC_MALLOC(sizeof(struct wilc_wfi_key));
                                priv->wilc_ptk[key_index]->key = NULL;
                                priv->wilc_ptk[key_index]->seq = NULL;
                        }
@@ -1221,7 +1224,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
                                if (priv->wilc_gtk[key_index]->key)
                                        kfree(priv->wilc_gtk[key_index]->key);
 
-                               priv->wilc_gtk[key_index]->key = (u8 *)WILC_MALLOC(params->key_len);
+                               priv->wilc_gtk[key_index]->key = WILC_MALLOC(params->key_len);
                                memcpy(priv->wilc_gtk[key_index]->key, params->key, params->key_len);
 
                                /* if there has been previous allocation for the same index through its seq, free that memory and allocate again*/
@@ -1229,7 +1232,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
                                        kfree(priv->wilc_gtk[key_index]->seq);
 
                                if ((params->seq_len) > 0) {
-                                       priv->wilc_gtk[key_index]->seq = (u8 *)WILC_MALLOC(params->seq_len);
+                                       priv->wilc_gtk[key_index]->seq = WILC_MALLOC(params->seq_len);
                                        memcpy(priv->wilc_gtk[key_index]->seq, params->seq, params->seq_len);
                                }
 
@@ -1267,13 +1270,13 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
                                if (priv->wilc_ptk[key_index]->key)
                                        kfree(priv->wilc_ptk[key_index]->key);
 
-                               priv->wilc_ptk[key_index]->key = (u8 *)WILC_MALLOC(params->key_len);
+                               priv->wilc_ptk[key_index]->key = WILC_MALLOC(params->key_len);
 
                                if (priv->wilc_ptk[key_index]->seq)
                                        kfree(priv->wilc_ptk[key_index]->seq);
 
                                if ((params->seq_len) > 0)
-                                       priv->wilc_ptk[key_index]->seq = (u8 *)WILC_MALLOC(params->seq_len);
+                                       priv->wilc_ptk[key_index]->seq = WILC_MALLOC(params->seq_len);
 
                                if (INFO) {
                                        for (i = 0; i < params->key_len; i++)
@@ -2509,12 +2512,12 @@ int WILC_WFI_mgmt_tx(struct wiphy *wiphy,
        if (ieee80211_is_mgmt(mgmt->frame_control)) {
 
                /*mgmt frame allocation*/
-               mgmt_tx = (struct p2p_mgmt_data *)WILC_MALLOC(sizeof(struct p2p_mgmt_data));
+               mgmt_tx = WILC_MALLOC(sizeof(struct p2p_mgmt_data));
                if (mgmt_tx == NULL) {
                        PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
                        return WILC_FAIL;
                }
-               mgmt_tx->buff = (char *)WILC_MALLOC(buf_len);
+               mgmt_tx->buff = WILC_MALLOC(buf_len);
                if (mgmt_tx->buff == NULL) {
                        PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
                        return WILC_FAIL;
@@ -3069,7 +3072,7 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
 
                #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
                g_obtainingIP = true;
-               WILC_TimerStart(&hDuringIpTimer, duringIP_TIME, NULL);
+               mod_timer(&hDuringIpTimer, jiffies + msecs_to_jiffies(duringIP_TIME));
                #endif
                host_int_set_power_mgmt(priv->hWILCWFIDrv, 0, 0);
                /*BugID_5222*/
@@ -3824,9 +3827,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++;
This page took 0.029645 seconds and 5 git commands to generate.