Skip to contentSkip to conversation

Simplify nvmet_init to remove extra out label

PATCH New Milan P. Gandhi 2 participants 2 messages Aug 9, 2018 – Aug 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Simplify nvmet_init to remove extra out label

The 2nd out label at end could easily be removed by returning an error upon receiving a non-zero error return code from nvmet_init_discovery. This would avoid need for 2nd out label.

Signed-off-by Milan P. Gandhi <mgandhi at redhat.com>
---
 drivers/nvme/target/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/nvme/target/core.c +1 -2
index b40fb6d724b4..e667a3fa0d9b 100644
@@ -1109,7 +1109,7 @@ static int __init nvmet_init(void)
 
 	error = nvmet_init_discovery();
 	if (error)
-		goto out;
+		return error;
 
 	error = nvmet_init_configfs();
 	if (error)
@@ -1118,7 +1118,6 @@ static int __init nvmet_init(void)
 
 out_exit_discovery:
 	nvmet_exit_discovery();
-out:
 	return error;
 }
 
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 Simplify nvmet_init to remove extra out label

Quoted 6 lines · Milan P. Gandhi

The 2nd out label at end could easily be removed by returning an error upon receiving a non-zero error return code from nvmet_init_discovery. This would avoid need for 2nd out label.

Signed-off-by Milan P. Gandhi <mgandhi at redhat.com>

And what does this buy us?