Thread (5 messages) 5 messages, 2 authors, 2021-10-25
STALE1677d

[PATCH] staging: r8188eu: core: remove goto statement

From: Saurav Girepunje <hidden>
Date: 2021-10-25 12:15:20
Also in: linux-staging
Subsystem: staging subsystem, the rest · Maintainers: Greg Kroah-Hartman, Linus Torvalds

Remove the goto statement from rtw_do_join(). In this function goto
can be replace by return statement. As on goto label exit, function only
return it is not performing any cleanup. Avoiding goto will improve
the function readability.

Signed-off-by: Saurav Girepunje <redacted>
---
 drivers/staging/r8188eu/core/rtw_ioctl_set.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index 2b54cdfa9d6e..411b06e135be 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -51,7 +51,7 @@ u8 rtw_do_join(struct adapter *padapter)
 			ret = _FAIL;
 		}

-		goto exit;
+		return ret;
 	} else {
 		int select_ret;
@@ -78,10 +78,9 @@ u8 rtw_do_join(struct adapter *padapter)

 				rtw_generate_random_ibss(pibss);

-				if (rtw_createbss_cmd(padapter) != _SUCCESS) {
-					ret =  false;
-					goto exit;
-				}
+				if (rtw_createbss_cmd(padapter) != _SUCCESS)
+					return false;
+
 				pmlmepriv->to_join = false;
 			} else {
 				/*  can't associate ; reset under-linking */
@@ -102,8 +101,6 @@ u8 rtw_do_join(struct adapter *padapter)
 		}
 	}

-exit:
-
 	return ret;
 }

--
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help