Simplify nvmet_init to remove extra out label
Subsystems (2)
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
@@ -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
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?