nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()
Simplify this function implementation by using a known function. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
This commit is contained in:
parent
97b3807e93
commit
1179d337be
|
@ -381,9 +381,7 @@ int __init nvmet_init_discovery(void)
|
|||
{
|
||||
nvmet_disc_subsys =
|
||||
nvmet_subsys_alloc(NVME_DISC_SUBSYS_NAME, NVME_NQN_DISC);
|
||||
if (IS_ERR(nvmet_disc_subsys))
|
||||
return PTR_ERR(nvmet_disc_subsys);
|
||||
return 0;
|
||||
return PTR_ERR_OR_ZERO(nvmet_disc_subsys);
|
||||
}
|
||||
|
||||
void nvmet_exit_discovery(void)
|
||||
|
|
Loading…
Reference in New Issue