[PATCH 06/13] 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          |  3 ++-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 26 +++++++++--------------
 3 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7ef5d18..143e35f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7074,11 +7074,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..fd50f11 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;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 0d5ffaf..f4cc53f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3306,11 +3306,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;
 }
 
@@ -3376,12 +3374,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;
 }
 
@@ -3421,11 +3417,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;
 }
 
@@ -3492,11 +3487,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