staging: rtl8188eu: core: Remove useless cast on void pointer
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Thu, 30 Oct 2014 11:33:08 +0000 (17:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 20:05:48 +0000 (13:05 -0700)
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

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

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

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c
drivers/staging/rtl8188eu/core/rtw_debug.c
drivers/staging/rtl8188eu/core/rtw_efuse.c
drivers/staging/rtl8188eu/core/rtw_led.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
drivers/staging/rtl8188eu/core/rtw_recv.c

index 350d2e73b419bcc75a7c2b183cf798c0d16f69ca..7731cdb72b22f657be68e23fd648f76781a74c05 100644 (file)
@@ -167,7 +167,7 @@ int rtw_cmd_thread(void *context)
        struct cmd_obj *pcmd;
        u8 (*cmd_hdl)(struct adapter *padapter, u8 *pbuf);
        void (*pcmd_callback)(struct adapter *dev, struct cmd_obj *pcmd);
-       struct adapter *padapter = (struct adapter *)context;
+       struct adapter *padapter = context;
        struct cmd_priv *pcmdpriv = &(padapter->cmdpriv);
 
        allow_signal(SIGTERM);
index 1f72f7d8097ead3e44e8d3fd95f08bdfef8a5a58..bc3fe10ff247014c32ad4445a141173ee8b28fd0 100644 (file)
@@ -45,7 +45,7 @@ int proc_get_write_reg(char *page, char **start,
 int proc_set_write_reg(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        char tmp[32];
        u32 addr, val, len;
@@ -577,7 +577,7 @@ int proc_get_rx_signal(char *page, char **start,
 int proc_set_rx_signal(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        char tmp[32];
        u32 is_signal_dbg;
@@ -627,7 +627,7 @@ int proc_get_ht_enable(char *page, char **start,
 int proc_set_ht_enable(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        struct registry_priv    *pregpriv = &padapter->registrypriv;
        char tmp[32];
@@ -669,7 +669,7 @@ int proc_get_cbw40_enable(char *page, char **start,
 int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        struct registry_priv    *pregpriv = &padapter->registrypriv;
        char tmp[32];
@@ -710,7 +710,7 @@ int proc_get_ampdu_enable(char *page, char **start,
 int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        struct registry_priv    *pregpriv = &padapter->registrypriv;
        char tmp[32];
@@ -771,7 +771,7 @@ int proc_get_rx_stbc(char *page, char **start,
 int proc_set_rx_stbc(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        struct registry_priv    *pregpriv = &padapter->registrypriv;
        char tmp[32];
@@ -800,7 +800,7 @@ int proc_get_rssi_disp(char *page, char **start,
 int proc_set_rssi_disp(struct file *file, const char __user *buffer,
                unsigned long count, void *data)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_device *dev = data;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
        char tmp[32];
        u32 enable = 0;
index bc897da8c10350563f181dbb01f0399896722d89..31986670b7f0f6276c2a18bdb735ce012bafc572 100644 (file)
@@ -331,56 +331,56 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v
        case TYPE_EFUSE_MAX_SECTION:
                {
                        u8 *pMax_section;
-                       pMax_section = (u8 *)pOut;
+                       pMax_section = pOut;
                        *pMax_section = EFUSE_MAX_SECTION_88E;
                }
                break;
        case TYPE_EFUSE_REAL_CONTENT_LEN:
                {
                        u16 *pu2Tmp;
-                       pu2Tmp = (u16 *)pOut;
+                       pu2Tmp = pOut;
                        *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E;
                }
                break;
        case TYPE_EFUSE_CONTENT_LEN_BANK:
                {
                        u16 *pu2Tmp;
-                       pu2Tmp = (u16 *)pOut;
+                       pu2Tmp = pOut;
                        *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E;
                }
                break;
        case TYPE_AVAILABLE_EFUSE_BYTES_BANK:
                {
                        u16 *pu2Tmp;
-                       pu2Tmp = (u16 *)pOut;
+                       pu2Tmp = pOut;
                        *pu2Tmp = (u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E);
                }
                break;
        case TYPE_AVAILABLE_EFUSE_BYTES_TOTAL:
                {
                        u16 *pu2Tmp;
-                       pu2Tmp = (u16 *)pOut;
+                       pu2Tmp = pOut;
                        *pu2Tmp = (u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E);
                }
                break;
        case TYPE_EFUSE_MAP_LEN:
                {
                        u16 *pu2Tmp;
-                       pu2Tmp = (u16 *)pOut;
+                       pu2Tmp = pOut;
                        *pu2Tmp = (u16)EFUSE_MAP_LEN_88E;
                }
                break;
        case TYPE_EFUSE_PROTECT_BYTES_BANK:
                {
                        u8 *pu1Tmp;
-                       pu1Tmp = (u8 *)pOut;
+                       pu1Tmp = pOut;
                        *pu1Tmp = (u8)(EFUSE_OOB_PROTECT_BYTES_88E);
                }
                break;
        default:
                {
                        u8 *pu1Tmp;
-                       pu1Tmp = (u8 *)pOut;
+                       pu1Tmp = pOut;
                        *pu1Tmp = 0;
                }
                break;
index 384be22052e58b8e3d0f4eaba1b2c1d2620e8fe1..2aa62517e4a2ad872bea891211623c40a6431701 100644 (file)
@@ -28,7 +28,7 @@
 /*  */
 void BlinkTimerCallback(void *data)
 {
-       struct LED_871x *pLed = (struct LED_871x *)data;
+       struct LED_871x *pLed = data;
        struct adapter *padapter = pLed->padapter;
 
        if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
index b4e8504b34ed976e322540b31520cd394b722bca..dec26a89c356498a9fc968aae735151d3dd1c5bb 100644 (file)
@@ -1362,7 +1362,7 @@ void rtw_cpwm_event_callback(struct adapter *padapter, u8 *pbuf)
 */
 void _rtw_join_timeout_handler (void *function_context)
 {
-       struct adapter *adapter = (struct adapter *)function_context;
+       struct adapter *adapter = function_context;
        struct  mlme_priv *pmlmepriv = &adapter->mlmepriv;
        int do_join_r;
 
@@ -1404,7 +1404,7 @@ void _rtw_join_timeout_handler (void *function_context)
 */
 void rtw_scan_timeout_handler (void *function_context)
 {
-       struct adapter *adapter = (struct adapter *)function_context;
+       struct adapter *adapter = function_context;
        struct  mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
        DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
index 5ba5099ec20d1af8fd4415b8dbeab8d3dd1fdcc8..8bb490820557fafd63b5746bd892cc91cef203c6 100644 (file)
@@ -4835,7 +4835,7 @@ void linked_status_chk(struct adapter *padapter)
 
 void survey_timer_hdl(void *function_context)
 {
-       struct adapter *padapter = (struct adapter *)function_context;
+       struct adapter *padapter = function_context;
        struct cmd_obj  *ph2c;
        struct sitesurvey_parm  *psurveyPara;
        struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
@@ -4912,7 +4912,7 @@ void link_timer_hdl(void *function_context)
 
 void addba_timer_hdl(void *function_context)
 {
-       struct sta_info *psta = (struct sta_info *)function_context;
+       struct sta_info *psta = function_context;
        struct ht_priv  *phtpriv;
 
        if (!psta)
index 27ed83cca193588a3db80cb550bc0a10f3049416..768dbeee94c44fc21a24be8743f0bd7a9c5510c2 100644 (file)
@@ -284,7 +284,7 @@ exit:
 
 static void pwr_state_check_handler(void *FunctionContext)
 {
-       struct adapter *padapter = (struct adapter *)FunctionContext;
+       struct adapter *padapter = FunctionContext;
        rtw_ps_cmd(padapter);
 }
 
index 4d56dbad2a7d3998ee7486ccda6bf7fe6c0283a3..53a054c189e4a76c3a999d270992a083a91040d2 100644 (file)
@@ -1949,7 +1949,7 @@ _err_exit:
 
 void rtw_reordering_ctrl_timeout_handler(void *pcontext)
 {
-       struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)pcontext;
+       struct recv_reorder_ctrl *preorder_ctrl = pcontext;
        struct adapter *padapter = preorder_ctrl->padapter;
        struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;