Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()
@ 2019-09-06 18:00 Markus Elfring
  2019-09-06 18:13 ` Sagi Grimberg
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-06 18:00 UTC (permalink / raw)
  To: linux-nvme, Christoph Hellwig, Sagi Grimberg
  Cc: YueHaibing, zhong jiang, kernel-janitors, LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Sep 2019 19:50:19 +0200

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>
---
 drivers/nvme/target/discovery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
index 8efca26b4776..3764a8900850 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -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)
--
2.23.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()
  2019-09-06 18:00 [PATCH] nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery() Markus Elfring
@ 2019-09-06 18:13 ` Sagi Grimberg
  0 siblings, 0 replies; 2+ messages in thread
From: Sagi Grimberg @ 2019-09-06 18:13 UTC (permalink / raw)
  To: Markus Elfring, linux-nvme, Christoph Hellwig
  Cc: YueHaibing, zhong jiang, kernel-janitors, LKML

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

applied to nvme-5.4

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 18:00 [PATCH] nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery() Markus Elfring
2019-09-06 18:13 ` Sagi Grimberg

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org linux-nvme@archiver.kernel.org
	public-inbox-index linux-nvme


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/ public-inbox