Skip to content

Commit

Permalink
nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()
Browse files Browse the repository at this point in the history
Simplify this function implementation by using a known function.

Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
  • Loading branch information
elfring authored and sagigrimberg committed Sep 12, 2019
1 parent 97b3807 commit 1179d33
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/nvme/target/discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1179d33

Please sign in to comment.