[OPW,kernel,v3,13/28] staging: rtl8723au: hal: hal_com.c: Replace non-standard return values
diff mbox

Message ID 1414668396-4093-14-git-send-email-roberta.dobrescu@gmail.com
State New, archived
Headers show

Commit Message

Roberta Dobrescu Oct. 30, 2014, 11:26 a.m. UTC
This patch replaces non-standard return values _SUCCESS/_FAIL with 0
or an appropriate err code and modifies the code according to that.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
---
 drivers/staging/rtl8723au/hal/hal_com.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c
index bf4cae2..e15a8d8 100644
--- a/drivers/staging/rtl8723au/hal/hal_com.c
+++ b/drivers/staging/rtl8723au/hal/hal_com.c
@@ -358,20 +358,25 @@  void c2h_evt_clear23a(struct rtw_adapter *adapter)
 
 int c2h_evt_read23a(struct rtw_adapter *adapter, u8 *buf)
 {
-	int ret = _FAIL;
+	int ret;
 	struct c2h_evt_hdr *c2h_evt;
 	int i;
 	u8 trigger;
 
-	if (buf == NULL)
+	if (buf == NULL) {
+		ret = -EINVAL;
 		goto exit;
+	}
 
 	trigger = rtl8723au_read8(adapter, REG_C2HEVT_CLEAR);
 
-	if (trigger == C2H_EVT_HOST_CLOSE)
+	if (trigger == C2H_EVT_HOST_CLOSE) {
+		ret = -EBUSY;
 		goto exit;	/* Not ready */
-	else if (trigger != C2H_EVT_FW_CLOSE)
+	} else if (trigger != C2H_EVT_FW_CLOSE) {
+		ret = -EFAULT;
 		goto clear_evt;	/* Not a valid value */
+	}
 
 	c2h_evt = (struct c2h_evt_hdr *)buf;
 
@@ -399,7 +404,7 @@  int c2h_evt_read23a(struct rtw_adapter *adapter, u8 *buf)
 		      "c2h_evt_read23a(): Command Content:\n", c2h_evt->payload,
 		      c2h_evt->plen);
 
-	ret = _SUCCESS;
+	ret = 0;
 
 clear_evt:
 	/*