]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: wilc1000: wilc_wfi_cfgoperations: remove cast on void pointers
authorAlison Schofield <amsfield22@gmail.com>
Sat, 13 Feb 2016 06:54:08 +0000 (22:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 00:31:44 +0000 (16:31 -0800)
Remove cast on void pointers. C programming language guarantees
the conversion from void pointer to any other pointer type.

Coccinelle patch:
@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index 97d1b802a75e12613704d1ba66fb4974ca63f1bd..81a2ee9d7c323fd5bc228ad6444635fc6ee2d704 100644 (file)
@@ -228,7 +228,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
        int i;
        int rssi = 0;
 
-       priv = (struct wilc_priv *)user_void;
+       priv = user_void;
        wiphy = priv->dev->ieee80211_ptr->wiphy;
 
        for (i = 0; i < last_scanned_cnt; i++) {
@@ -404,7 +404,7 @@ static void CfgScanResult(enum scan_event scan_event,
        struct ieee80211_channel *channel;
        struct cfg80211_bss *bss = NULL;
 
-       priv = (struct wilc_priv *)user_void;
+       priv = user_void;
        if (priv->bCfgScanning) {
                if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
                        wiphy = priv->dev->ieee80211_ptr->wiphy;
@@ -525,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 
        wilc_connecting = 0;
 
-       priv = (struct wilc_priv *)pUserVoid;
+       priv = pUserVoid;
        dev = priv->dev;
        vif = netdev_priv(dev);
        wl = vif->wilc;
@@ -1713,7 +1713,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)
 
 static void WILC_WFI_mgmt_tx_complete(void *priv, int status)
 {
-       struct p2p_mgmt_data *pv_data = (struct p2p_mgmt_data *)priv;
+       struct p2p_mgmt_data *pv_data = priv;
 
 
        kfree(pv_data->buff);
@@ -1724,7 +1724,7 @@ static void WILC_WFI_RemainOnChannelReady(void *pUserVoid)
 {
        struct wilc_priv *priv;
 
-       priv = (struct wilc_priv *)pUserVoid;
+       priv = pUserVoid;
 
        priv->bInP2PlistenState = true;
 
@@ -1739,7 +1739,7 @@ static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, u32 u32SessionID)
 {
        struct wilc_priv *priv;
 
-       priv = (struct wilc_priv *)pUserVoid;
+       priv = pUserVoid;
 
        if (u32SessionID == priv->strRemainOnChanParams.u32ListenSessionID) {
                priv->bInP2PlistenState = false;