diff mbox series

Simplify nvmet_init to remove extra out label

Message ID 20180809113209.GA10820@machine1 (mailing list archive)
State Not Applicable
Headers show
Series Simplify nvmet_init to remove extra out label | expand

Commit Message

Milan P. Gandhi Aug. 9, 2018, 11:32 a.m. UTC
The out label at end could easily be removed by returning
an error upon receiving non-zero error return code from
nvmet_init_discovery. This would avoid need for 2nd out
label.

Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
---
 drivers/nvme/target/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Thumshirn Aug. 9, 2018, 11:51 a.m. UTC | #1
please send this patch to the correct mailing list (linux-nvme@lists.infradead.org)
Milan P. Gandhi Aug. 9, 2018, 12:07 p.m. UTC | #2
Thank you Johannes,
I will send it on linux-nvme@lists.infradead.org
On Thu, Aug 09, 2018 at 01:51:18PM +0200, Johannes Thumshirn wrote:
> please send this patch to the correct mailing list (linux-nvme@lists.infradead.org)
> 
> -- 
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
diff mbox series

Patch

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index b40fb6d724b4..e667a3fa0d9b 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -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;
 }