Skip to contentSkip to conversation

staging: rtl8188eu: goto replaced by 'else' branch

PATCH In review Ivan Safonov 2 participants 3 messages Nov 6, 2015 – Nov 7, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: rtl8188eu: goto replaced by 'else' branch

goto is not needed here.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +11 -14
index 1d03727..c0fff77 100644
@@ -201,23 +201,20 @@ _next:
 
 		if (rtw_cmd_filter(pcmdpriv, pcmd) == _FAIL) {
 			pcmd->res = H2C_DROPPED;
-			goto post_process;
-		}
-
-		if (pcmd->cmdcode < ARRAY_SIZE(wlancmds)) {
-			cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
-
-			if (cmd_hdl) {
-				ret = cmd_hdl(pcmd->padapter, pcmd->parmbuf);
-				pcmd->res = ret;
-			}
 		} else {
-			pcmd->res = H2C_PARAMETERS_ERROR;
-		}
+			if (pcmd->cmdcode < ARRAY_SIZE(wlancmds)) {
+			    cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
 
-		cmd_hdl = NULL;
+				if (cmd_hdl) {
+					ret = cmd_hdl(pcmd->padapter, pcmd->parmbuf);
+					pcmd->res = ret;
+				}
+			} else {
+				pcmd->res = H2C_PARAMETERS_ERROR;
+			}
 
-post_process:
+			cmd_hdl = NULL;
+		}
 
 		/* call callback function for post-processed */
 		if (pcmd->cmdcode < ARRAY_SIZE(rtw_cmd_callback)) {
Signature · 1 line
2.4.10
#1 lore raw
Quoted 7 lines · Ivan Safonov

goto is not needed here.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

I've applied most of these patches, but I got a bit confused about what order for some of these. Can you please look at what I applied and resend what I missed, in a single set of patches that are properly numbered so I have a chance to get it right?

thanks,

greg k-h

#2 lore raw
Quoted 8 lines · Greg Kroah-Hartman
Quoted 7 lines · Ivan Safonov

goto is not needed here.

---
  drivers/staging/rtl8188eu/core/rtw_cmd.c | 25 +++++++++++--------------
  1 file changed, 11 insertions(+), 14 deletions(-)
Quoted 8 lines

I've applied most of these patches, but I got a bit confused about what order for some of these. Can you please look at what I applied and resend what I missed, in a single set of patches that are properly numbered so I have a chance to get it right?

thanks,

greg k-h

Yes, of course.