All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix issues detected by coccinelle
@ 2015-10-12 17:30 Shivani Bhardwaj
  2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 17:30 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch removes useless casts and code.
After applying this patch, code becomes better and compact.

Shivani Bhardwaj (3):
  Staging: wilc1000: host_interface: Remove extra NULL test
  Staging: wilc1000: host_interface: Remove useless cast
  Staging: wilc1000: host_interface: Remove unused code

 drivers/staging/wilc1000/host_interface.c | 100 +-----------------------------
 1 file changed, 1 insertion(+), 99 deletions(-)

-- 
2.1.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test
  2015-10-12 17:30 [PATCH v2 0/3] Fix issues detected by coccinelle Shivani Bhardwaj
@ 2015-10-12 17:32 ` Shivani Bhardwaj
  2015-10-12 18:00   ` [Outreachy kernel] " Daniel Baluta
  2015-10-12 18:50   ` Arnd Bergmann
  2015-10-12 17:32 ` [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast Shivani Bhardwaj
  2015-10-12 17:33 ` [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
  2 siblings, 2 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 17:32 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove NULL test statement as it is preceded by another NULL test on the
same variable in the code.
Issue found using coccinelle.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
Changes in v2:
	Deleted one patch and added another. Improved the other ones.
 drivers/staging/wilc1000/host_interface.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index bb833d3..5e4d620 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6044,12 +6044,9 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
 	if (ret)
 		s32Error = -ENOENT;
 
-	if (pstrWFIDrv != NULL) {
 		kfree(pstrWFIDrv);
 		/* pstrWFIDrv=NULL; */
 
-	}
-
 	clients_count--; /* Decrease number of created entities */
 	terminated_handle = NULL;
 	up(&hSemHostIntDeinit);
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 17:30 [PATCH v2 0/3] Fix issues detected by coccinelle Shivani Bhardwaj
  2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
@ 2015-10-12 17:32 ` Shivani Bhardwaj
  2015-10-12 18:49   ` [Outreachy kernel] " Arnd Bergmann
  2015-10-12 19:28   ` Julia Lawall
  2015-10-12 17:33 ` [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
  2 siblings, 2 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 17:32 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove useless casts that occur throughout the code.
Issue detected using coccinelle.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
Changes in v2:
        Deleted one patch and added another. Improved the other ones.

 drivers/staging/wilc1000/host_interface.c | 82 +------------------------------
 1 file changed, 1 insertion(+), 81 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5e4d620..6c41e62 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
 
 	s32 s32Error = 0;
 	tstrWID	strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	/*prepare configuration packet*/
 	strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
@@ -649,8 +648,6 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler,
 
 	s32 s32Error = 0;
 	tstrWID	strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
 
 	/*prepare configuration packet*/
 	strWID.u16WIDid = (u16)WID_SET_OPERATION_MODE;
@@ -692,7 +689,6 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
 	s32 s32Error = 0;
 	tstrWID strWID;
 	char firmwareIPAddress[4] = {0};
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	if (pu8IPAddr[0] < 192)
 		pu8IPAddr[0] = 0;
@@ -738,7 +734,6 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
 
 	s32 s32Error = 0;
 	tstrWID strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	/*prepare configuration packet*/
 	strWID.u16WIDid = (u16)WID_IP_ADDRESS;
@@ -787,7 +782,6 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler,
 
 	s32 s32Error = 0;
 	tstrWID	strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 	u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
 
 	if (mac_buf == NULL) {
@@ -865,8 +859,6 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWIDList[32];
 	u8 u8WidCnt = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
 
 	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
@@ -1229,7 +1221,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler,
 	u8 *pu8Buffer;
 	u8 valuesize = 0;
 	u8 *pu8HdnNtwrksWidVal = NULL;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "Setting SCAN params\n");
 	PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", pstrWFIDrv->enuHostIFstate);
@@ -1390,9 +1381,6 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
 {
 	s32 s32Error = 0;
 
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
-
 	u8 u8abort_running_scan;
 	tstrWID strWID;
 
@@ -1446,7 +1434,6 @@ u8 u8ConnectedSSID[6] = {0};
 static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler,
 			  struct connect_attr *pstrHostIFconnectAttr)
 {
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 	s32 s32Error = 0;
 	tstrWID strWIDList[8];
 	u32 u32WidsCount = 0, dummyval = 0;
@@ -1871,7 +1858,6 @@ static s32 Handle_ConnectTimeout(tstrWILC_WFIDrv *drvHandler)
 	tstrConnectInfo strConnectInfo;
 	tstrWID strWID;
 	u16 u16DummyReasonCode = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
 	if (pstrWFIDrv == NULL)	{
 		PRINT_ER("Driver handler is NULL\n");
@@ -1985,10 +1971,6 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler,
 	tstrNetworkInfo *pstrNetworkInfo = NULL;
 	void *pJoinParams = NULL;
 
-	tstrWILC_WFIDrv *pstrWFIDrv  = (tstrWILC_WFIDrv *)drvHandler;
-
-
-
 	bNewNtwrkFound = true;
 	PRINT_INFO(HOSTINF_DBG, "Handling received network info\n");
 
@@ -2106,7 +2088,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler,
 	tstrConnectInfo strConnectInfo;
 	tstrDisconnectNotifInfo strDisconnectNotifInfo;
 	s32 s32Err = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
 	if (!pstrWFIDrv) {
 		PRINT_ER("Driver handler is NULL\n");
@@ -2415,8 +2396,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler,
 	u8 *pu8keybuf;
 	s8 s8idxarray[1];
 	s8 ret = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
 
 	switch (pstrHostIFkeyAttr->enuKeyType) {
 
@@ -2775,8 +2754,6 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
 
 	s32 s32Error = 0;
 	u16 u16DummyReasonCode = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
 
 	strWID.u16WIDid = (u16)WID_DISCONNECT;
 	strWID.enuWIDtype = WID_CHAR;
@@ -2900,8 +2877,6 @@ static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
 
 	s32 s32Error = 0;
 	tstrWID	strWID;
-	/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
 	strWID.enuWIDtype = WID_CHAR;
@@ -2940,7 +2915,6 @@ static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
 {
 	s32 s32Error = 0;
 	tstrWID strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_RSSI;
 	strWID.enuWIDtype = WID_CHAR;
@@ -2967,7 +2941,6 @@ static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
 {
 	s32 s32Error = 0;
 	tstrWID strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	gs8lnkspd = 0;
 
@@ -3054,8 +3027,6 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	u8 *stamac;
 	tstrWID	strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-
 
 	strWID.u16WIDid = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
 	strWID.enuWIDtype = WID_STR;
@@ -3120,7 +3091,6 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "Adding BEACON\n");
 
@@ -3188,7 +3158,6 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler)
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_DEL_BEACON;
 	strWID.enuWIDtype = WID_CHAR;
@@ -3281,7 +3250,6 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "Handling add station\n");
 	strWID.u16WIDid = (u16)WID_ADD_STA;
@@ -3322,7 +3290,7 @@ static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler,
 
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
+
 	u8 i;
 	u8 au8Zero_Buff[6] = {0};
 
@@ -3377,7 +3345,6 @@ static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_REMOVE_STA;
 	strWID.enuWIDtype = WID_BIN;
@@ -3419,7 +3386,6 @@ static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_EDIT_STA;
 	strWID.enuWIDtype = WID_BIN;
@@ -3459,7 +3425,6 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	u8 u8remain_on_chan_flag;
 	tstrWID strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
 	/*If it's a pendig remain-on-channel, don't overwrite gWFiDrvHandle values (since incoming msg is garbbage)*/
 	if (!pstrWFIDrv->u8RemainOnChan_pendingreq) {
@@ -3546,7 +3511,6 @@ static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	u8 *pu8CurrByte;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "Handling frame register Flag : %d FrameType: %d\n", pstrHostIfRegisterFrame->bReg, pstrHostIfRegisterFrame->u16FrameType);
 
@@ -3595,7 +3559,6 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler,
 	u8 u8remain_on_chan_flag;
 	tstrWID strWID;
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
 
@@ -3681,7 +3644,6 @@ static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	s8 s8PowerMode;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	strWID.u16WIDid = (u16)WID_POWER_MANAGEMENT;
 
@@ -3769,7 +3731,6 @@ static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler,
 	tstrWID strWID;
 	int AddbaTimeout = 100;
 	char *ptr = NULL;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	PRINT_D(HOSTINF_DBG, "Opening Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\nBufferSize == %d\nSessionTimeOut = %d\n",
 		strHostIfBASessionInfo->au8Bssid[0],
@@ -3857,7 +3818,6 @@ static s32 Handle_DelAllRxBASessions(tstrWILC_WFIDrv *drvHandler,
 	s32 s32Error = 0;
 	tstrWID strWID;
 	char *ptr = NULL;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 	PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n",
 		strHostIfBASessionInfo->au8Bssid[0],
@@ -4235,7 +4195,6 @@ int host_int_remove_wep_key(tstrWILC_WFIDrv *wfi_drv, u8 index)
 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 
@@ -4290,7 +4249,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
 {
 
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -4352,7 +4310,6 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
 {
 
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	u8 i;
 
@@ -4425,7 +4382,6 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
 			     const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	u8 u8KeyLen = u8PtkKeylen;
 	u32 i;
@@ -4521,7 +4477,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
 				const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	u8 u8KeyLen = u8GtkKeylen;
 
@@ -4622,7 +4577,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	u32 i;
 
@@ -4898,7 +4852,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
 				  void *pJoinParams)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	tenuScanConnTimer enuScanConnTimer;
 
@@ -5028,7 +4981,6 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
 {
 	s32 s32Error = 0;
 	struct host_if_msg msg;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
 	if (pstrWFIDrv == NULL) {
 		PRINT_ER("Driver is null\n");
@@ -5135,7 +5087,6 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
 {
 	s32 s32Error = 0;
 	tstrWID strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
 	if (pstrWFIDrv == NULL) {
 		PRINT_ER("Driver is null\n");
@@ -5317,7 +5268,6 @@ int host_int_set_operation_mode(tstrWILC_WFIDrv *wfi_drv, u32 mode)
 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -5359,7 +5309,6 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -5403,8 +5352,6 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
 
 	s32 s32Error = 0;
 	tstrWID	strWID;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
-
 
 	if (pstrWFIDrv == NULL) {
 		PRINT_ER("driver is null\n");
@@ -5448,8 +5395,6 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
 {
 	s32 s32Error = 0;
 	struct host_if_msg msg;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
-
 
 	/* prepare the Get RSSI Message */
 	memset(&msg, 0, sizeof(struct host_if_msg));
@@ -5484,10 +5429,6 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
 	struct host_if_msg msg;
 	s32 s32Error = 0;
 
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
-
-
-
 	/* prepare the Get LINKSPEED Message */
 	memset(&msg, 0, sizeof(struct host_if_msg));
 
@@ -5564,7 +5505,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
 			  struct hidden_network *pstrHiddenNetwork)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	tenuScanConnTimer enuScanConnTimer;
 
@@ -5632,7 +5572,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
 {
 
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
 	struct host_if_msg msg;
 
@@ -5670,7 +5609,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
 	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
@@ -5967,8 +5905,6 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
 	int ret;
 
 	/*obtain driver handle*/
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
-
 	if (pstrWFIDrv == NULL)	{
 		PRINT_ER("pstrWFIDrv = NULL\n");
 		return 0;
@@ -6229,7 +6165,6 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
 s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, wilc_remain_on_chan_ready RemainOnChanReady, void *pvUserArg)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -6274,7 +6209,6 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
 s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -6309,7 +6243,6 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
 s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -6366,7 +6299,6 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
 				u32 u32TailLen, u8 *pu8Tail)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info;
 
@@ -6435,7 +6367,6 @@ ERRORHANDLER:
 s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
@@ -6469,7 +6400,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
 			 struct add_sta_param *pstrStaParams)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
 
@@ -6518,7 +6448,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
 s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info;
 
@@ -6559,7 +6488,6 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
 s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info;
 	u8 au8Zero_Buff[ETH_ALEN] = {0};
@@ -6620,7 +6548,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
 			  struct add_sta_param *pstrStaParams)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
 
@@ -6659,7 +6586,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info;
 
@@ -6692,8 +6618,6 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
 s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count)
 {
 	s32 s32Error = 0;
-
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
 
@@ -6942,7 +6866,6 @@ void host_int_freeJoinParams(void *pJoinParams)
 s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct ba_session_info *pBASessionInfo = &msg.body.session_info;
 
@@ -6972,7 +6895,6 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
 s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 	struct ba_session_info *pBASessionInfo = &msg.body.session_info;
 
@@ -7010,7 +6932,6 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
 s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	/* TODO: Enable This feature on softap firmware */
@@ -7050,7 +6971,6 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
 s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
 {
 	s32 s32Error = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 	struct host_if_msg msg;
 
 	if (pstrWFIDrv == NULL) {
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code
  2015-10-12 17:30 [PATCH v2 0/3] Fix issues detected by coccinelle Shivani Bhardwaj
  2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
  2015-10-12 17:32 ` [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast Shivani Bhardwaj
@ 2015-10-12 17:33 ` Shivani Bhardwaj
  2015-10-12 18:47   ` [Outreachy kernel] " Arnd Bergmann
  2015-10-12 19:26   ` Julia Lawall
  2 siblings, 2 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 17:33 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove declaration and initialization of variables that are not used
anywhere in the code.
Issue found using coccinelle.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
Changes in v2:
        Deleted one patch and added another. Improved the other ones.

 drivers/staging/wilc1000/host_interface.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6c41e62..e36c767 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -449,12 +449,6 @@ typedef struct _tstrBssTable {
 	tstrJoinBssParam *tail;
 } tstrBssTable;
 
-typedef enum {
-	SCAN_TIMER = 0,
-	CONNECT_TIMER	= 1,
-	SCAN_CONNECT_TIMER_FORCE_32BIT = 0xFFFFFFFF
-} tenuScanConnTimer;
-
 /*****************************************************************************/
 /*																			 */
 /*							Global Variabls	                                                                 */
@@ -4853,7 +4847,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
 {
 	s32 s32Error = 0;
 	struct host_if_msg msg;
-	tenuScanConnTimer enuScanConnTimer;
 
 	if (pstrWFIDrv == NULL || pfConnectResult == NULL) {
 		s32Error = -EFAULT;
@@ -4861,11 +4854,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
 		return s32Error;
 	}
 
-	if (hWFIDrv == NULL) {
-		PRINT_ER("Driver is null\n");
-		return -EFAULT;
-	}
-
 	if (pJoinParams == NULL) {
 		PRINT_ER("Unable to Join - JoinParams is NULL\n");
 		return -EFAULT;
@@ -4916,7 +4904,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
 		return -EFAULT;
 	}
 
-	enuScanConnTimer = CONNECT_TIMER;
 	pstrWFIDrv->hConnectTimer.data = (unsigned long)hWFIDrv;
 	mod_timer(&pstrWFIDrv->hConnectTimer,
 		  jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
@@ -5506,7 +5493,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
 {
 	s32 s32Error = 0;
 	struct host_if_msg msg;
-	tenuScanConnTimer enuScanConnTimer;
 
 	if (pstrWFIDrv == NULL || ScanResult == NULL) {
 		PRINT_ER("pstrWFIDrv or ScanResult = NULL\n");
@@ -5548,7 +5534,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
 		return -EINVAL;
 	}
 
-	enuScanConnTimer = SCAN_TIMER;
 	PRINT_D(HOSTINF_DBG, ">> Starting the SCAN timer\n");
 	pstrWFIDrv->hScanTimer.data = (unsigned long)hWFIDrv;
 	mod_timer(&pstrWFIDrv->hScanTimer,
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test
  2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
@ 2015-10-12 18:00   ` Daniel Baluta
  2015-10-12 18:50   ` Arnd Bergmann
  1 sibling, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2015-10-12 18:00 UTC (permalink / raw)
  To: Shivani Bhardwaj; +Cc: outreachy-kernel

On Mon, Oct 12, 2015 at 8:54 PM, Shivani Bhardwaj <shivanib134@gmail.com> wrote:
> Remove NULL test statement as it is preceded by another NULL test on the
> same variable in the code.
> Issue found using coccinelle.
>
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> Changes in v2:
>         Deleted one patch and added another. Improved the other ones.
>  drivers/staging/wilc1000/host_interface.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index bb833d3..5e4d620 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -6044,12 +6044,9 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>         if (ret)
>                 s32Error = -ENOENT;
>
> -       if (pstrWFIDrv != NULL) {
>                 kfree(pstrWFIDrv);
>                 /* pstrWFIDrv=NULL; */

You should also remove this comment.

>
> -       }
> -
>         clients_count--; /* Decrease number of created entities */
>         terminated_handle = NULL;
>         up(&hSemHostIntDeinit);
> --
> 2.1.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/3f3303356a62e08e17ffde7cdc8531d5b1fd34bc.1444670615.git.shivanib134%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code
  2015-10-12 17:33 ` [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
@ 2015-10-12 18:47   ` Arnd Bergmann
  2015-10-12 19:26   ` Julia Lawall
  1 sibling, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2015-10-12 18:47 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Shivani Bhardwaj

On Monday 12 October 2015 23:03:33 Shivani Bhardwaj wrote:
> Remove declaration and initialization of variables that are not used
> anywhere in the code.
> Issue found using coccinelle.
> 
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>

Nice find!

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

> ---
> Changes in v2:
>         Deleted one patch and added another. Improved the other ones.
> 

This text makes more sense in the introductory mail (PATCH 0/3) than
in the individual patches.

	Arnd


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 17:32 ` [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast Shivani Bhardwaj
@ 2015-10-12 18:49   ` Arnd Bergmann
  2015-10-12 18:51     ` Shivani Bhardwaj
  2015-10-12 19:28   ` Julia Lawall
  1 sibling, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2015-10-12 18:49 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Shivani Bhardwaj

On Monday 12 October 2015 23:02:53 Shivani Bhardwaj wrote:
> @@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
>  
>         s32 s32Error = 0;
>         tstrWID strWID;
> -       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>         /*prepare configuration packet*/
>         strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
> 

In the code I'm looking at, the variable is still used, just the cast
can be removed. I haven't checked the other variables, but I'd guess
that the same is true for them, because gcc tends to warn otherwise.

	Arnd


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test
  2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
  2015-10-12 18:00   ` [Outreachy kernel] " Daniel Baluta
@ 2015-10-12 18:50   ` Arnd Bergmann
  2015-10-12 18:52     ` Shivani Bhardwaj
  1 sibling, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2015-10-12 18:50 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Shivani Bhardwaj

On Monday 12 October 2015 23:02:01 Shivani Bhardwaj wrote:
> Remove NULL test statement as it is preceded by another NULL test on the
> same variable in the code.
> Issue found using coccinelle.
> 
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> Changes in v2:
>         Deleted one patch and added another. Improved the other ones.
>  drivers/staging/wilc1000/host_interface.c | 3 ---
>  1 file changed, 3 deletions(-)

In the text above, it makes sense to provide an abbreviated
version of the semantic patch when you send something that was
generated by coccinelle.

> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index bb833d3..5e4d620 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -6044,12 +6044,9 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>         if (ret)
>                 s32Error = -ENOENT;
>  
> -       if (pstrWFIDrv != NULL) {
>                 kfree(pstrWFIDrv);
>                 /* pstrWFIDrv=NULL; */
>  
> -       }
> -

Now the indentation of the kfree() is wrong, it needs to go one tabstop
to the left. Also, the comment behind it can be removed in the same
patch.

	Arnd


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 18:49   ` [Outreachy kernel] " Arnd Bergmann
@ 2015-10-12 18:51     ` Shivani Bhardwaj
  2015-10-12 19:34       ` Julia Lawall
  0 siblings, 1 reply; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 18:51 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: outreachy-kernel

On Tue, Oct 13, 2015 at 12:19 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 12 October 2015 23:02:53 Shivani Bhardwaj wrote:
>> @@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
>>
>>         s32 s32Error = 0;
>>         tstrWID strWID;
>> -       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>         /*prepare configuration packet*/
>>         strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
>>
>
> In the code I'm looking at, the variable is still used, just the cast
> can be removed. I haven't checked the other variables, but I'd guess
> that the same is true for them, because gcc tends to warn otherwise.
>
>         Arnd
>
Yes, Arnd. I've just removed the cast throughout the code. The
variable is still used in the code. Unused code removal is given in
other patch of same series.
Thank you
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/31296892.7kyR2l26jl%40wuerfel.
> For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test
  2015-10-12 18:50   ` Arnd Bergmann
@ 2015-10-12 18:52     ` Shivani Bhardwaj
  0 siblings, 0 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 18:52 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: outreachy-kernel

On Tue, Oct 13, 2015 at 12:20 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 12 October 2015 23:02:01 Shivani Bhardwaj wrote:
>> Remove NULL test statement as it is preceded by another NULL test on the
>> same variable in the code.
>> Issue found using coccinelle.
>>
>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> ---
>> Changes in v2:
>>         Deleted one patch and added another. Improved the other ones.
>>  drivers/staging/wilc1000/host_interface.c | 3 ---
>>  1 file changed, 3 deletions(-)
>
> In the text above, it makes sense to provide an abbreviated
> version of the semantic patch when you send something that was
> generated by coccinelle.
>
>> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
>> index bb833d3..5e4d620 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -6044,12 +6044,9 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>>         if (ret)
>>                 s32Error = -ENOENT;
>>
>> -       if (pstrWFIDrv != NULL) {
>>                 kfree(pstrWFIDrv);
>>                 /* pstrWFIDrv=NULL; */
>>
>> -       }
>> -
>
> Now the indentation of the kfree() is wrong, it needs to go one tabstop
> to the left. Also, the comment behind it can be removed in the same
> patch.
>
>         Arnd
Yes, I'm fixing that and removing the comment. Sending v3.
thank you.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code
  2015-10-12 17:33 ` [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
  2015-10-12 18:47   ` [Outreachy kernel] " Arnd Bergmann
@ 2015-10-12 19:26   ` Julia Lawall
  1 sibling, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2015-10-12 19:26 UTC (permalink / raw)
  To: Shivani Bhardwaj; +Cc: outreachy-kernel



On Mon, 12 Oct 2015, Shivani Bhardwaj wrote:

> Remove declaration and initialization of variables that are not used
> anywhere in the code.
> Issue found using coccinelle.

You also removed the typedef.  That should be in the commit message.

julia

> 
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> Changes in v2:
>         Deleted one patch and added another. Improved the other ones.
> 
>  drivers/staging/wilc1000/host_interface.c | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 6c41e62..e36c767 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -449,12 +449,6 @@ typedef struct _tstrBssTable {
>  	tstrJoinBssParam *tail;
>  } tstrBssTable;
>  
> -typedef enum {
> -	SCAN_TIMER = 0,
> -	CONNECT_TIMER	= 1,
> -	SCAN_CONNECT_TIMER_FORCE_32BIT = 0xFFFFFFFF
> -} tenuScanConnTimer;
> -
>  /*****************************************************************************/
>  /*																			 */
>  /*							Global Variabls	                                                                 */
> @@ -4853,7 +4847,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
>  {
>  	s32 s32Error = 0;
>  	struct host_if_msg msg;
> -	tenuScanConnTimer enuScanConnTimer;
>  
>  	if (pstrWFIDrv == NULL || pfConnectResult == NULL) {
>  		s32Error = -EFAULT;
> @@ -4861,11 +4854,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
>  		return s32Error;
>  	}
>  
> -	if (hWFIDrv == NULL) {
> -		PRINT_ER("Driver is null\n");
> -		return -EFAULT;
> -	}
> -
>  	if (pJoinParams == NULL) {
>  		PRINT_ER("Unable to Join - JoinParams is NULL\n");
>  		return -EFAULT;
> @@ -4916,7 +4904,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
>  		return -EFAULT;
>  	}
>  
> -	enuScanConnTimer = CONNECT_TIMER;
>  	pstrWFIDrv->hConnectTimer.data = (unsigned long)hWFIDrv;
>  	mod_timer(&pstrWFIDrv->hConnectTimer,
>  		  jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
> @@ -5506,7 +5493,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
>  {
>  	s32 s32Error = 0;
>  	struct host_if_msg msg;
> -	tenuScanConnTimer enuScanConnTimer;
>  
>  	if (pstrWFIDrv == NULL || ScanResult == NULL) {
>  		PRINT_ER("pstrWFIDrv or ScanResult = NULL\n");
> @@ -5548,7 +5534,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
>  		return -EINVAL;
>  	}
>  
> -	enuScanConnTimer = SCAN_TIMER;
>  	PRINT_D(HOSTINF_DBG, ">> Starting the SCAN timer\n");
>  	pstrWFIDrv->hScanTimer.data = (unsigned long)hWFIDrv;
>  	mod_timer(&pstrWFIDrv->hScanTimer,
> -- 
> 2.1.0
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/89a5b09ad425b0a21649a5438e3311f92ade83a6.1444670615.git.shivanib134%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 17:32 ` [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast Shivani Bhardwaj
  2015-10-12 18:49   ` [Outreachy kernel] " Arnd Bergmann
@ 2015-10-12 19:28   ` Julia Lawall
  2015-10-12 19:47     ` Shivani Bhardwaj
  1 sibling, 1 reply; 14+ messages in thread
From: Julia Lawall @ 2015-10-12 19:28 UTC (permalink / raw)
  To: Shivani Bhardwaj; +Cc: outreachy-kernel



On Mon, 12 Oct 2015, Shivani Bhardwaj wrote:

> Remove useless casts that occur throughout the code.
> Issue detected using coccinelle.
> 
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> Changes in v2:
>         Deleted one patch and added another. Improved the other ones.
> 
>  drivers/staging/wilc1000/host_interface.c | 82 +------------------------------
>  1 file changed, 1 insertion(+), 81 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 5e4d620..6c41e62 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
>  
>  	s32 s32Error = 0;
>  	tstrWID	strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;

This is too much.  I think the varialbe is still used?  You should just 
remove the (tstrWILC_WFIDrv *).

julia

>  
>  	/*prepare configuration packet*/
>  	strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
> @@ -649,8 +648,6 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler,
>  
>  	s32 s32Error = 0;
>  	tstrWID	strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
>  
>  	/*prepare configuration packet*/
>  	strWID.u16WIDid = (u16)WID_SET_OPERATION_MODE;
> @@ -692,7 +689,6 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	char firmwareIPAddress[4] = {0};
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	if (pu8IPAddr[0] < 192)
>  		pu8IPAddr[0] = 0;
> @@ -738,7 +734,6 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
>  
>  	s32 s32Error = 0;
>  	tstrWID strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	/*prepare configuration packet*/
>  	strWID.u16WIDid = (u16)WID_IP_ADDRESS;
> @@ -787,7 +782,6 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler,
>  
>  	s32 s32Error = 0;
>  	tstrWID	strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  	u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
>  
>  	if (mac_buf == NULL) {
> @@ -865,8 +859,6 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWIDList[32];
>  	u8 u8WidCnt = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
>  
>  	down(&(pstrWFIDrv->gtOsCfgValuesSem));
>  
> @@ -1229,7 +1221,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler,
>  	u8 *pu8Buffer;
>  	u8 valuesize = 0;
>  	u8 *pu8HdnNtwrksWidVal = NULL;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "Setting SCAN params\n");
>  	PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", pstrWFIDrv->enuHostIFstate);
> @@ -1390,9 +1381,6 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
>  {
>  	s32 s32Error = 0;
>  
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
> -
>  	u8 u8abort_running_scan;
>  	tstrWID strWID;
>  
> @@ -1446,7 +1434,6 @@ u8 u8ConnectedSSID[6] = {0};
>  static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler,
>  			  struct connect_attr *pstrHostIFconnectAttr)
>  {
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  	s32 s32Error = 0;
>  	tstrWID strWIDList[8];
>  	u32 u32WidsCount = 0, dummyval = 0;
> @@ -1871,7 +1858,6 @@ static s32 Handle_ConnectTimeout(tstrWILC_WFIDrv *drvHandler)
>  	tstrConnectInfo strConnectInfo;
>  	tstrWID strWID;
>  	u16 u16DummyReasonCode = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
>  	if (pstrWFIDrv == NULL)	{
>  		PRINT_ER("Driver handler is NULL\n");
> @@ -1985,10 +1971,6 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler,
>  	tstrNetworkInfo *pstrNetworkInfo = NULL;
>  	void *pJoinParams = NULL;
>  
> -	tstrWILC_WFIDrv *pstrWFIDrv  = (tstrWILC_WFIDrv *)drvHandler;
> -
> -
> -
>  	bNewNtwrkFound = true;
>  	PRINT_INFO(HOSTINF_DBG, "Handling received network info\n");
>  
> @@ -2106,7 +2088,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler,
>  	tstrConnectInfo strConnectInfo;
>  	tstrDisconnectNotifInfo strDisconnectNotifInfo;
>  	s32 s32Err = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
>  	if (!pstrWFIDrv) {
>  		PRINT_ER("Driver handler is NULL\n");
> @@ -2415,8 +2396,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler,
>  	u8 *pu8keybuf;
>  	s8 s8idxarray[1];
>  	s8 ret = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
>  
>  	switch (pstrHostIFkeyAttr->enuKeyType) {
>  
> @@ -2775,8 +2754,6 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
>  
>  	s32 s32Error = 0;
>  	u16 u16DummyReasonCode = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
>  
>  	strWID.u16WIDid = (u16)WID_DISCONNECT;
>  	strWID.enuWIDtype = WID_CHAR;
> @@ -2900,8 +2877,6 @@ static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
>  
>  	s32 s32Error = 0;
>  	tstrWID	strWID;
> -	/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
>  	strWID.enuWIDtype = WID_CHAR;
> @@ -2940,7 +2915,6 @@ static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
>  {
>  	s32 s32Error = 0;
>  	tstrWID strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_RSSI;
>  	strWID.enuWIDtype = WID_CHAR;
> @@ -2967,7 +2941,6 @@ static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
>  {
>  	s32 s32Error = 0;
>  	tstrWID strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	gs8lnkspd = 0;
>  
> @@ -3054,8 +3027,6 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	u8 *stamac;
>  	tstrWID	strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> -
>  
>  	strWID.u16WIDid = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
>  	strWID.enuWIDtype = WID_STR;
> @@ -3120,7 +3091,6 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "Adding BEACON\n");
>  
> @@ -3188,7 +3158,6 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler)
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_DEL_BEACON;
>  	strWID.enuWIDtype = WID_CHAR;
> @@ -3281,7 +3250,6 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "Handling add station\n");
>  	strWID.u16WIDid = (u16)WID_ADD_STA;
> @@ -3322,7 +3290,7 @@ static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler,
>  
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> +
>  	u8 i;
>  	u8 au8Zero_Buff[6] = {0};
>  
> @@ -3377,7 +3345,6 @@ static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_REMOVE_STA;
>  	strWID.enuWIDtype = WID_BIN;
> @@ -3419,7 +3386,6 @@ static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_EDIT_STA;
>  	strWID.enuWIDtype = WID_BIN;
> @@ -3459,7 +3425,6 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	u8 u8remain_on_chan_flag;
>  	tstrWID strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
>  	/*If it's a pendig remain-on-channel, don't overwrite gWFiDrvHandle values (since incoming msg is garbbage)*/
>  	if (!pstrWFIDrv->u8RemainOnChan_pendingreq) {
> @@ -3546,7 +3511,6 @@ static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	u8 *pu8CurrByte;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "Handling frame register Flag : %d FrameType: %d\n", pstrHostIfRegisterFrame->bReg, pstrHostIfRegisterFrame->u16FrameType);
>  
> @@ -3595,7 +3559,6 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler,
>  	u8 u8remain_on_chan_flag;
>  	tstrWID strWID;
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
>  
> @@ -3681,7 +3644,6 @@ static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	s8 s8PowerMode;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	strWID.u16WIDid = (u16)WID_POWER_MANAGEMENT;
>  
> @@ -3769,7 +3731,6 @@ static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler,
>  	tstrWID strWID;
>  	int AddbaTimeout = 100;
>  	char *ptr = NULL;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	PRINT_D(HOSTINF_DBG, "Opening Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\nBufferSize == %d\nSessionTimeOut = %d\n",
>  		strHostIfBASessionInfo->au8Bssid[0],
> @@ -3857,7 +3818,6 @@ static s32 Handle_DelAllRxBASessions(tstrWILC_WFIDrv *drvHandler,
>  	s32 s32Error = 0;
>  	tstrWID strWID;
>  	char *ptr = NULL;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>  
>  	PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n",
>  		strHostIfBASessionInfo->au8Bssid[0],
> @@ -4235,7 +4195,6 @@ int host_int_remove_wep_key(tstrWILC_WFIDrv *wfi_drv, u8 index)
>  s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  
> @@ -4290,7 +4249,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
>  {
>  
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -4352,7 +4310,6 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
>  {
>  
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	u8 i;
>  
> @@ -4425,7 +4382,6 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
>  			     const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	u8 u8KeyLen = u8PtkKeylen;
>  	u32 i;
> @@ -4521,7 +4477,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
>  				const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	u8 u8KeyLen = u8GtkKeylen;
>  
> @@ -4622,7 +4577,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
>  s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	u32 i;
>  
> @@ -4898,7 +4852,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
>  				  void *pJoinParams)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	tenuScanConnTimer enuScanConnTimer;
>  
> @@ -5028,7 +4981,6 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
>  {
>  	s32 s32Error = 0;
>  	struct host_if_msg msg;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  
>  	if (pstrWFIDrv == NULL) {
>  		PRINT_ER("Driver is null\n");
> @@ -5135,7 +5087,6 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
>  {
>  	s32 s32Error = 0;
>  	tstrWID strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  
>  	if (pstrWFIDrv == NULL) {
>  		PRINT_ER("Driver is null\n");
> @@ -5317,7 +5268,6 @@ int host_int_set_operation_mode(tstrWILC_WFIDrv *wfi_drv, u32 mode)
>  s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -5359,7 +5309,6 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
>  s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -5403,8 +5352,6 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
>  
>  	s32 s32Error = 0;
>  	tstrWID	strWID;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
> -
>  
>  	if (pstrWFIDrv == NULL) {
>  		PRINT_ER("driver is null\n");
> @@ -5448,8 +5395,6 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
>  {
>  	s32 s32Error = 0;
>  	struct host_if_msg msg;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
> -
>  
>  	/* prepare the Get RSSI Message */
>  	memset(&msg, 0, sizeof(struct host_if_msg));
> @@ -5484,10 +5429,6 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
>  	struct host_if_msg msg;
>  	s32 s32Error = 0;
>  
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
> -
> -
> -
>  	/* prepare the Get LINKSPEED Message */
>  	memset(&msg, 0, sizeof(struct host_if_msg));
>  
> @@ -5564,7 +5505,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
>  			  struct hidden_network *pstrHiddenNetwork)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	tenuScanConnTimer enuScanConnTimer;
>  
> @@ -5632,7 +5572,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
>  {
>  
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  
>  	struct host_if_msg msg;
>  
> @@ -5670,7 +5609,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
>  s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  
>  	down(&(pstrWFIDrv->gtOsCfgValuesSem));
>  
> @@ -5967,8 +5905,6 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>  	int ret;
>  
>  	/*obtain driver handle*/
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
> -
>  	if (pstrWFIDrv == NULL)	{
>  		PRINT_ER("pstrWFIDrv = NULL\n");
>  		return 0;
> @@ -6229,7 +6165,6 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
>  s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, wilc_remain_on_chan_ready RemainOnChanReady, void *pvUserArg)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -6274,7 +6209,6 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
>  s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -6309,7 +6243,6 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
>  s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -6366,7 +6299,6 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
>  				u32 u32TailLen, u8 *pu8Tail)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info;
>  
> @@ -6435,7 +6367,6 @@ ERRORHANDLER:
>  s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> @@ -6469,7 +6400,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
>  			 struct add_sta_param *pstrStaParams)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
>  
> @@ -6518,7 +6448,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
>  s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info;
>  
> @@ -6559,7 +6488,6 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
>  s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info;
>  	u8 au8Zero_Buff[ETH_ALEN] = {0};
> @@ -6620,7 +6548,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
>  			  struct add_sta_param *pstrStaParams)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
>  
> @@ -6659,7 +6586,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
>  s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info;
>  
> @@ -6692,8 +6618,6 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
>  s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count)
>  {
>  	s32 s32Error = 0;
> -
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
>  
> @@ -6942,7 +6866,6 @@ void host_int_freeJoinParams(void *pJoinParams)
>  s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct ba_session_info *pBASessionInfo = &msg.body.session_info;
>  
> @@ -6972,7 +6895,6 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>  s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  	struct ba_session_info *pBASessionInfo = &msg.body.session_info;
>  
> @@ -7010,7 +6932,6 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
>  s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	/* TODO: Enable This feature on softap firmware */
> @@ -7050,7 +6971,6 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>  s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>  {
>  	s32 s32Error = 0;
> -	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>  	struct host_if_msg msg;
>  
>  	if (pstrWFIDrv == NULL) {
> -- 
> 2.1.0
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/aa140d8daabc374f3cc6bfc12625164e47b37acb.1444670615.git.shivanib134%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 18:51     ` Shivani Bhardwaj
@ 2015-10-12 19:34       ` Julia Lawall
  0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2015-10-12 19:34 UTC (permalink / raw)
  To: Shivani Bhardwaj; +Cc: Arnd Bergmann, outreachy-kernel



On Tue, 13 Oct 2015, Shivani Bhardwaj wrote:

> On Tue, Oct 13, 2015 at 12:19 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 12 October 2015 23:02:53 Shivani Bhardwaj wrote:
> >> @@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
> >>
> >>         s32 s32Error = 0;
> >>         tstrWID strWID;
> >> -       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> >>
> >>         /*prepare configuration packet*/
> >>         strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
> >>
> >
> > In the code I'm looking at, the variable is still used, just the cast
> > can be removed. I haven't checked the other variables, but I'd guess
> > that the same is true for them, because gcc tends to warn otherwise.
> >
> >         Arnd
> >
> Yes, Arnd. I've just removed the cast throughout the code. The
> variable is still used in the code. Unused code removal is given in
> other patch of same series.

Shivani, the whole thing disappeared somehow.  You should have a + line 
with the variable declaration.

julia


> Thank you
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/31296892.7kyR2l26jl%40wuerfel.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKHNQQGS3mmm5aDbfuviH2F-5a%2BGgM4JG0qCwTb3e6xE_t%3Du2Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast
  2015-10-12 19:28   ` Julia Lawall
@ 2015-10-12 19:47     ` Shivani Bhardwaj
  0 siblings, 0 replies; 14+ messages in thread
From: Shivani Bhardwaj @ 2015-10-12 19:47 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

On Tue, Oct 13, 2015 at 12:58 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Mon, 12 Oct 2015, Shivani Bhardwaj wrote:
>
>> Remove useless casts that occur throughout the code.
>> Issue detected using coccinelle.
>>
>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> ---
>> Changes in v2:
>>         Deleted one patch and added another. Improved the other ones.
>>
>>  drivers/staging/wilc1000/host_interface.c | 82 +------------------------------
>>  1 file changed, 1 insertion(+), 81 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
>> index 5e4d620..6c41e62 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -573,7 +573,6 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler,
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>
> This is too much.  I think the varialbe is still used?  You should just
> remove the (tstrWILC_WFIDrv *).
>
> julia
>

I just realized what Arnd had to say. I'm so sorry. I'm correcting
this. Really very sorry. A big mistake.
Thank you

>>
>>       /*prepare configuration packet*/
>>       strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
>> @@ -649,8 +648,6 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler,
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>>
>>       /*prepare configuration packet*/
>>       strWID.u16WIDid = (u16)WID_SET_OPERATION_MODE;
>> @@ -692,7 +689,6 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       char firmwareIPAddress[4] = {0};
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       if (pu8IPAddr[0] < 192)
>>               pu8IPAddr[0] = 0;
>> @@ -738,7 +734,6 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       /*prepare configuration packet*/
>>       strWID.u16WIDid = (u16)WID_IP_ADDRESS;
>> @@ -787,7 +782,6 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler,
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>       u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
>>
>>       if (mac_buf == NULL) {
>> @@ -865,8 +859,6 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWIDList[32];
>>       u8 u8WidCnt = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>>
>>       down(&(pstrWFIDrv->gtOsCfgValuesSem));
>>
>> @@ -1229,7 +1221,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler,
>>       u8 *pu8Buffer;
>>       u8 valuesize = 0;
>>       u8 *pu8HdnNtwrksWidVal = NULL;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "Setting SCAN params\n");
>>       PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", pstrWFIDrv->enuHostIFstate);
>> @@ -1390,9 +1381,6 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
>>  {
>>       s32 s32Error = 0;
>>
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>> -
>>       u8 u8abort_running_scan;
>>       tstrWID strWID;
>>
>> @@ -1446,7 +1434,6 @@ u8 u8ConnectedSSID[6] = {0};
>>  static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler,
>>                         struct connect_attr *pstrHostIFconnectAttr)
>>  {
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>       s32 s32Error = 0;
>>       tstrWID strWIDList[8];
>>       u32 u32WidsCount = 0, dummyval = 0;
>> @@ -1871,7 +1858,6 @@ static s32 Handle_ConnectTimeout(tstrWILC_WFIDrv *drvHandler)
>>       tstrConnectInfo strConnectInfo;
>>       tstrWID strWID;
>>       u16 u16DummyReasonCode = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>
>>       if (pstrWFIDrv == NULL) {
>>               PRINT_ER("Driver handler is NULL\n");
>> @@ -1985,10 +1971,6 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler,
>>       tstrNetworkInfo *pstrNetworkInfo = NULL;
>>       void *pJoinParams = NULL;
>>
>> -     tstrWILC_WFIDrv *pstrWFIDrv  = (tstrWILC_WFIDrv *)drvHandler;
>> -
>> -
>> -
>>       bNewNtwrkFound = true;
>>       PRINT_INFO(HOSTINF_DBG, "Handling received network info\n");
>>
>> @@ -2106,7 +2088,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler,
>>       tstrConnectInfo strConnectInfo;
>>       tstrDisconnectNotifInfo strDisconnectNotifInfo;
>>       s32 s32Err = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>
>>       if (!pstrWFIDrv) {
>>               PRINT_ER("Driver handler is NULL\n");
>> @@ -2415,8 +2396,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler,
>>       u8 *pu8keybuf;
>>       s8 s8idxarray[1];
>>       s8 ret = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>>
>>       switch (pstrHostIFkeyAttr->enuKeyType) {
>>
>> @@ -2775,8 +2754,6 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
>>
>>       s32 s32Error = 0;
>>       u16 u16DummyReasonCode = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>>
>>       strWID.u16WIDid = (u16)WID_DISCONNECT;
>>       strWID.enuWIDtype = WID_CHAR;
>> @@ -2900,8 +2877,6 @@ static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     /* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL;
>>       strWID.enuWIDtype = WID_CHAR;
>> @@ -2940,7 +2915,6 @@ static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
>>  {
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_RSSI;
>>       strWID.enuWIDtype = WID_CHAR;
>> @@ -2967,7 +2941,6 @@ static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
>>  {
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       gs8lnkspd = 0;
>>
>> @@ -3054,8 +3027,6 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       u8 *stamac;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> -
>>
>>       strWID.u16WIDid = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
>>       strWID.enuWIDtype = WID_STR;
>> @@ -3120,7 +3091,6 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "Adding BEACON\n");
>>
>> @@ -3188,7 +3158,6 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler)
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_DEL_BEACON;
>>       strWID.enuWIDtype = WID_CHAR;
>> @@ -3281,7 +3250,6 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "Handling add station\n");
>>       strWID.u16WIDid = (u16)WID_ADD_STA;
>> @@ -3322,7 +3290,7 @@ static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler,
>>
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> +
>>       u8 i;
>>       u8 au8Zero_Buff[6] = {0};
>>
>> @@ -3377,7 +3345,6 @@ static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_REMOVE_STA;
>>       strWID.enuWIDtype = WID_BIN;
>> @@ -3419,7 +3386,6 @@ static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_EDIT_STA;
>>       strWID.enuWIDtype = WID_BIN;
>> @@ -3459,7 +3425,6 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       u8 u8remain_on_chan_flag;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>
>>       /*If it's a pendig remain-on-channel, don't overwrite gWFiDrvHandle values (since incoming msg is garbbage)*/
>>       if (!pstrWFIDrv->u8RemainOnChan_pendingreq) {
>> @@ -3546,7 +3511,6 @@ static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       u8 *pu8CurrByte;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "Handling frame register Flag : %d FrameType: %d\n", pstrHostIfRegisterFrame->bReg, pstrHostIfRegisterFrame->u16FrameType);
>>
>> @@ -3595,7 +3559,6 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler,
>>       u8 u8remain_on_chan_flag;
>>       tstrWID strWID;
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
>>
>> @@ -3681,7 +3644,6 @@ static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       s8 s8PowerMode;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       strWID.u16WIDid = (u16)WID_POWER_MANAGEMENT;
>>
>> @@ -3769,7 +3731,6 @@ static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler,
>>       tstrWID strWID;
>>       int AddbaTimeout = 100;
>>       char *ptr = NULL;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       PRINT_D(HOSTINF_DBG, "Opening Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\nBufferSize == %d\nSessionTimeOut = %d\n",
>>               strHostIfBASessionInfo->au8Bssid[0],
>> @@ -3857,7 +3818,6 @@ static s32 Handle_DelAllRxBASessions(tstrWILC_WFIDrv *drvHandler,
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>>       char *ptr = NULL;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>>
>>       PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n",
>>               strHostIfBASessionInfo->au8Bssid[0],
>> @@ -4235,7 +4195,6 @@ int host_int_remove_wep_key(tstrWILC_WFIDrv *wfi_drv, u8 index)
>>  s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>
>> @@ -4290,7 +4249,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
>>  {
>>
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -4352,7 +4310,6 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
>>  {
>>
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       u8 i;
>>
>> @@ -4425,7 +4382,6 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
>>                            const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       u8 u8KeyLen = u8PtkKeylen;
>>       u32 i;
>> @@ -4521,7 +4477,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
>>                               const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       u8 u8KeyLen = u8GtkKeylen;
>>
>> @@ -4622,7 +4577,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
>>  s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       u32 i;
>>
>> @@ -4898,7 +4852,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
>>                                 void *pJoinParams)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       tenuScanConnTimer enuScanConnTimer;
>>
>> @@ -5028,7 +4981,6 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
>>  {
>>       s32 s32Error = 0;
>>       struct host_if_msg msg;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>
>>       if (pstrWFIDrv == NULL) {
>>               PRINT_ER("Driver is null\n");
>> @@ -5135,7 +5087,6 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
>>  {
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>
>>       if (pstrWFIDrv == NULL) {
>>               PRINT_ER("Driver is null\n");
>> @@ -5317,7 +5268,6 @@ int host_int_set_operation_mode(tstrWILC_WFIDrv *wfi_drv, u32 mode)
>>  s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -5359,7 +5309,6 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
>>  s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -5403,8 +5352,6 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
>>
>>       s32 s32Error = 0;
>>       tstrWID strWID;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>> -
>>
>>       if (pstrWFIDrv == NULL) {
>>               PRINT_ER("driver is null\n");
>> @@ -5448,8 +5395,6 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
>>  {
>>       s32 s32Error = 0;
>>       struct host_if_msg msg;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>> -
>>
>>       /* prepare the Get RSSI Message */
>>       memset(&msg, 0, sizeof(struct host_if_msg));
>> @@ -5484,10 +5429,6 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
>>       struct host_if_msg msg;
>>       s32 s32Error = 0;
>>
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>> -
>> -
>> -
>>       /* prepare the Get LINKSPEED Message */
>>       memset(&msg, 0, sizeof(struct host_if_msg));
>>
>> @@ -5564,7 +5505,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
>>                         struct hidden_network *pstrHiddenNetwork)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       tenuScanConnTimer enuScanConnTimer;
>>
>> @@ -5632,7 +5572,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
>>  {
>>
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>
>>       struct host_if_msg msg;
>>
>> @@ -5670,7 +5609,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal)
>>  s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>
>>       down(&(pstrWFIDrv->gtOsCfgValuesSem));
>>
>> @@ -5967,8 +5905,6 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>>       int ret;
>>
>>       /*obtain driver handle*/
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>> -
>>       if (pstrWFIDrv == NULL) {
>>               PRINT_ER("pstrWFIDrv = NULL\n");
>>               return 0;
>> @@ -6229,7 +6165,6 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
>>  s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, wilc_remain_on_chan_ready RemainOnChanReady, void *pvUserArg)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -6274,7 +6209,6 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
>>  s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -6309,7 +6243,6 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
>>  s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -6366,7 +6299,6 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
>>                               u32 u32TailLen, u8 *pu8Tail)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info;
>>
>> @@ -6435,7 +6367,6 @@ ERRORHANDLER:
>>  s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> @@ -6469,7 +6400,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
>>                        struct add_sta_param *pstrStaParams)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
>>
>> @@ -6518,7 +6448,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
>>  s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info;
>>
>> @@ -6559,7 +6488,6 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
>>  s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info;
>>       u8 au8Zero_Buff[ETH_ALEN] = {0};
>> @@ -6620,7 +6548,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
>>                         struct add_sta_param *pstrStaParams)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
>>
>> @@ -6659,7 +6586,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
>>  s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info;
>>
>> @@ -6692,8 +6618,6 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
>>  s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count)
>>  {
>>       s32 s32Error = 0;
>> -
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
>>
>> @@ -6942,7 +6866,6 @@ void host_int_freeJoinParams(void *pJoinParams)
>>  s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct ba_session_info *pBASessionInfo = &msg.body.session_info;
>>
>> @@ -6972,7 +6895,6 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>>  s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>       struct ba_session_info *pBASessionInfo = &msg.body.session_info;
>>
>> @@ -7010,7 +6932,6 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
>>  s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       /* TODO: Enable This feature on softap firmware */
>> @@ -7050,7 +6971,6 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>>  s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
>>  {
>>       s32 s32Error = 0;
>> -     tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
>>       struct host_if_msg msg;
>>
>>       if (pstrWFIDrv == NULL) {
>> --
>> 2.1.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/aa140d8daabc374f3cc6bfc12625164e47b37acb.1444670615.git.shivanib134%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-10-12 19:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-12 17:30 [PATCH v2 0/3] Fix issues detected by coccinelle Shivani Bhardwaj
2015-10-12 17:32 ` [PATCH v2 1/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
2015-10-12 18:00   ` [Outreachy kernel] " Daniel Baluta
2015-10-12 18:50   ` Arnd Bergmann
2015-10-12 18:52     ` Shivani Bhardwaj
2015-10-12 17:32 ` [PATCH v2 2/3] Staging: wilc1000: host_interface: Remove useless cast Shivani Bhardwaj
2015-10-12 18:49   ` [Outreachy kernel] " Arnd Bergmann
2015-10-12 18:51     ` Shivani Bhardwaj
2015-10-12 19:34       ` Julia Lawall
2015-10-12 19:28   ` Julia Lawall
2015-10-12 19:47     ` Shivani Bhardwaj
2015-10-12 17:33 ` [PATCH v2 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
2015-10-12 18:47   ` [Outreachy kernel] " Arnd Bergmann
2015-10-12 19:26   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.