Skip to contentSkip to conversation

staging: rtl8723bs: remove unnecessary goto jumps

PATCH Superseded Bryan Brattlof 2 participants 3 messages Apr 10, 2021 – Apr 11, 2021

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: rtl8723bs: remove unnecessary goto jumps

The next instruction for both 'goto exit' jump statements is to execute the exit jump instructions regardless. We can safely remove all jump statements from __init rtw_drv_entry()

This will also remove the extra line-break before module_init() that checkpatch.pl was concerned with.

---
Changes from:
v1: removed unnecessary edit of DBG_871X_LEVEL
v2: elaborated on steps to remove a checkpatch.pl warning

 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +0 -5
index 9fd926e1698f..39b6d4b6dec4 100644
@@ -517,12 +517,8 @@ static int __init rtw_drv_entry(void)
 	if (ret != 0) {
 		sdio_drvpriv.drv_registered = false;
 		rtw_ndev_notifier_unregister();
-		goto exit;
 	}
 
-	goto exit;
-
-exit:
 	DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
 	return ret;
 }
@@ -540,6 +536,5 @@ static void __exit rtw_drv_halt(void)
 	DBG_871X_LEVEL(_drv_always_, "module exit success\n");
 }
 
-
 module_init(rtw_drv_entry);
 module_exit(rtw_drv_halt);
Signature · 1 line
2.27.0
#1 lore raw
Quoted 6 lines · Bryan Brattlof

The next instruction for both 'goto exit' jump statements is to execute the exit jump instructions regardless. We can safely remove all jump statements from __init rtw_drv_entry()

This will also remove the extra line-break before module_init() that checkpatch.pl was concerned with.

When you say "also", that almost always means it should be a separate patch. Please do so here, try to do only "one logical thing" per kernel patch please.

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Bryan Brattlof

The next instruction for both 'goto exit' jump statements is to execute the exit jump instructions regardless. We can safely remove all jump statements from __init rtw_drv_entry()

Quoted 7 lines
Quoted 2 lines

This will also remove the extra line-break before module_init() that checkpatch.pl was concerned with.

When you say "also", that almost always means it should be a separate patch. Please do so here, try to do only "one logical thing" per kernel patch please.

Will do.

I'll resubmit a clean v4 without the extra bits.

Quoted 4 lines

thanks,

greg k-h

--
~Brayn