Blob Blame History Raw
From 1bdcb3666a83e533feb35a5a86e4e8e01b44dc18 Mon Sep 17 00:00:00 2001
From: Nishka Dasgupta <nishkadg.linux@gmail.com>
Date: Thu, 8 Aug 2019 12:10:05 +0530
Subject: [PATCH] staging: rtl8712: r8712_wlanhdr_to_ethhdr(): Change return values
Git-commit: 1bdcb3666a83e533feb35a5a86e4e8e01b44dc18
Patch-mainline: v5.4-rc1
References: jsc#SLE-13430

Change return values of r8712_wlanhdr_to_ethhdr from _SUCCESS/_FAIL to
0/-ENOMEM. Modify the function containing a call site of
r8712_wlanhdr_to_ethhdr so that it compares the return value to
0/-ENOMEM instead of _SUCCESS/_FAIL.
Change the return type of r8712_wlanhdr_to_ethhdr from sint to int to
match its prototype in corresponding .h file.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190808064012.12661-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/staging/rtl8712/rtl8712_recv.c | 4 ++--
 drivers/staging/rtl8712/rtl871x_recv.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index 3950b2424b64..0c5712898653 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -638,8 +638,8 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
 		}
 	} else { /*B/G mode*/
 		retval = r8712_wlanhdr_to_ethhdr(prframe);
-		if (retval != _SUCCESS)
-			return retval;
+		if (retval)
+			return _FAIL;
 		if (!padapter->driver_stopped && !padapter->surprise_removed) {
 			/* indicate this recv_frame */
 			r8712_recv_indicatepkt(padapter, prframe);
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 79c7a329e9f6..4fae3af36af5 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -585,7 +585,7 @@ sint r8712_validate_recv_frame(struct _adapter *adapter,
 	return retval;
 }
 
-sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
+int r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
 {
 	/*remove the wlanhdr and add the eth_hdr*/
 	sint	rmv_len;
@@ -628,14 +628,14 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
 		ptr = recvframe_pull(precvframe, (rmv_len -
 		      sizeof(struct ethhdr) + 2) - 24);
 		if (!ptr)
-			return _FAIL;
+			return -ENOMEM;
 		memcpy(ptr, get_rxmem(precvframe), 24);
 		ptr += 24;
 	} else {
 		ptr = recvframe_pull(precvframe, (rmv_len -
 		      sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
 		if (!ptr)
-			return _FAIL;
+			return -ENOMEM;
 	}
 
 	memcpy(ptr, pattrib->dst, ETH_ALEN);
@@ -645,7 +645,7 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
 
 		memcpy(ptr + 12, &be_tmp, 2);
 	}
-	return _SUCCESS;
+	return 0;
 }
 
 s32 r8712_recv_entry(union recv_frame *precvframe)
-- 
2.16.4