lkml.org 
[lkml]   [2018]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] vfio/pci: fix ptr_ret.cocci warnings
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(-)

--- 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)
\
 
 \ /
  Last update: 2018-11-10 23:46    [W:0.062 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site