[PATCH v2 06/11] staging: wilc1000: remove usage of WILC_ERRORCHECK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The WILC_ERRORCHECK macro is replaced with printout or direct call to
return statement, together with removal of several WILC_CATCH accompaniyng
WILC_ERRORCHECK.

Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx>
---
 drivers/staging/wilc1000/host_interface.c         |  6 ++----
 drivers/staging/wilc1000/wilc_msgqueue.c          |  7 ++----
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 26 +++++++++--------------
 3 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 058e9ad..3eb9203 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7006,11 +7006,9 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
 	PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
 
 	s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
-	WILC_ERRORCHECK(s32Error);
+	if (s32Error)
+		PRINT_ER("Failed to send delete beacon message\n");
 
-	WILC_CATCH(s32Error)
-	{
-	}
 	return s32Error;
 }
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index 6e032b8..4337efc 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -135,7 +135,8 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 		spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 	} else {
 		/* other non-timeout scenarios */
-		WILC_ERRORCHECK(s32RetStatus);
+		if (s32RetStatus)
+			return s32RetStatus;
 
 		if (pHandle->bExiting)
 			return WILC_FAIL;
@@ -167,9 +168,5 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 		spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 	}
 
-	WILC_CATCH(s32RetStatus)
-	{
-	}
-
 	return s32RetStatus;
 }
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 2677cf6..e8d7572 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3300,11 +3300,9 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
 
 	s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
 
-	WILC_ERRORCHECK(s32Error);
+	if (s32Error)
+		PRINT_ER("Delete beacon failed\n");
 
-	WILC_CATCH(s32Error)
-	{
-	}
 	return s32Error;
 }
 
@@ -3370,12 +3368,10 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", strStaParams.u16FlagsSet);
 
 		s32Error = host_int_add_station(priv->hWILCWFIDrv, &strStaParams);
-		WILC_ERRORCHECK(s32Error);
+		if (s32Error)
+			PRINT_ER("Add station failed\n");
 	}
 
-	WILC_CATCH(s32Error)
-	{
-	}
 	return s32Error;
 }
 
@@ -3415,11 +3411,10 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev,
 
 		s32Error = host_int_del_station(priv->hWILCWFIDrv, mac);
 
-		WILC_ERRORCHECK(s32Error);
-	}
-	WILC_CATCH(s32Error)
-	{
+		if (s32Error)
+			PRINT_ER("Delete station failed\n");
 	}
+
 	return s32Error;
 }
 
@@ -3486,11 +3481,10 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", strStaParams.u16FlagsSet);
 
 		s32Error = host_int_edit_station(priv->hWILCWFIDrv, &strStaParams);
-		WILC_ERRORCHECK(s32Error);
-	}
-	WILC_CATCH(s32Error)
-	{
+		if (s32Error)
+			PRINT_ER("Edit station failed\n");
 	}
+
 	return s32Error;
 }
 
-- 
2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux