[PATCH] vfio/pci: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: kbuild test robot <fengguang.wu@xxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
---

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(-)

--- 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)



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux