diff mbox series

vfio/pci: fix ptr_ret.cocci warnings

Message ID 20181110224451.GA23585@lkp-ne04 (mailing list archive)
State New, archived
Headers show
Series vfio/pci: fix ptr_ret.cocci warnings | expand

Commit Message

Fengguang Wu Nov. 10, 2018, 10:44 p.m. UTC
From: kbuild test robot <fengguang.wu@intel.com>

drivers/vfio/pci/vfio_pci.c:1396:8-14: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 25e57457f6f2 ("vfio/pci: Parallelize device open and release")
CC: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Alex-Williamson/vfio-pci-Parallelize-device-open-and-release/20181111-025016
base:   https://github.com/awilliam/linux-vfio.git next

 vfio_pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -1393,7 +1393,7 @@  static int vfio_pci_reflck_attach(struct
 
 	mutex_unlock(&reflck_lock);
 
-	return IS_ERR(vdev->reflck) ? PTR_ERR(vdev->reflck) : 0;
+	return PTR_ERR_OR_ZERO(vdev->reflck);
 }
 
 static void vfio_pci_reflck_release(struct kref *kref)