Skip to contentSkip to conversation

staging: r8188eu :os_dep: remove condition with no effect

PATCH In review Saurav Girepunje 2 participants 3 messages Aug 28, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu :os_dep: remove condition with no effect

Remove the condition with no effect (if == else) in usb_intf.c file.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -4
index bb85ab77fd26..849563b54727 100644
@@ -496,10 +496,8 @@ static int rtw_resume(struct usb_interface *pusb_intf)
 	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
 	int ret = 0;
 
-	if (pwrpriv->bInternalAutoSuspend)
-		ret = rtw_resume_process(padapter);
-	else
-		ret = rtw_resume_process(padapter);
+	ret = rtw_resume_process(padapter);
+
 	return ret;
 }
 

--
2.32.0

#1 lore raw
Quoted 14 lines · Saurav Girepunje

Remove the condition with no effect (if == else) in usb_intf.c file.

---
  drivers/staging/r8188eu/os_dep/usb_intf.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -0
index bb85ab77fd26..849563b54727 100644
@@ -496,10 +496,8 @@ static int rtw_resume(struct usb_interface *pusb_intf)
  	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;

drivers/staging/r8188eu/os_dep/usb_intf.c static int rtw_resume(struct usb_interface *pusb_intf) · line 502

Quoted 10 lines
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -4
  	int ret = 0;
 
-	if (pwrpriv->bInternalAutoSuspend)
-		ret = 
-	else
-		ret = rtw_resume_process(padapter);
+	ret = rtw_resume_process(padapter);
+
  	return ret;
  }

Thanks for your patch. Perhaps this could be further simplified to:

int ret = rtw_resume_process(padapter);

return ret;

or even:

return rtw_resume_process(padapter);

Best regards,
Michael

#2 lore raw
Quoted 29 lines · Michael Straube
Quoted 13 lines · Saurav Girepunje

Remove the condition with no effect (if == else) in usb_intf.c file.

---
  drivers/staging/r8188eu/os_dep/usb_intf.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -0
index bb85ab77fd26..849563b54727 100644

drivers/staging/r8188eu/os_dep/usb_intf.c static int rtw_resume(struct usb_interface *pusb_intf) · line 502

Quoted 10 lines
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -3
@@ -496,10 +496,8 @@ static int rtw_resume(struct usb_interface *pusb_intf)
  	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
  	int ret = 0;
 
-	if (pwrpriv->bInternalAutoSuspend)
-		ret = -	else
-		ret = rtw_resume_process(padapter);
+	ret = rtw_resume_process(padapter);
+
  	return ret;
  }

Thanks for your patch. Perhaps this could be further simplified to:

int ret = rtw_resume_process(padapter);

Quoted 8 lines

return ret;

or even:

return rtw_resume_process(padapter);

Best regards,
Michael

Yes, Thanks Michael. I will make it more simple and send v2.

Regards,
Saurav