Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720754 > unrolled thread

[PATCH] virtio_mmio: Use PTR_ERROR_OR_ZERO

Started byHimanshu Jha <himanshujha199640@gmail.com>
First post2017-08-27 08:40 +0200
Last post2017-08-27 08:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] virtio_mmio: Use PTR_ERROR_OR_ZERO Himanshu Jha <himanshujha199640@gmail.com> - 2017-08-27 08:40 +0200

#1720754 — [PATCH] virtio_mmio: Use PTR_ERROR_OR_ZERO

FromHimanshu Jha <himanshujha199640@gmail.com>
Date2017-08-27 08:40 +0200
Subject[PATCH] virtio_mmio: Use PTR_ERROR_OR_ZERO
Message-ID<uiZoJ-3VU-7@gated-at.bofh.it>
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/virtio/virtio_mmio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 74dc717..fea209d 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -650,10 +650,7 @@ static int vm_cmdline_set(const char *device,
 	pdev = platform_device_register_resndata(&vm_cmdline_parent,
 			"virtio-mmio", vm_cmdline_id++,
 			resources, ARRAY_SIZE(resources), NULL, 0);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 
 static int vm_cmdline_get_device(struct device *dev, void *data)
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web