vfio: Use ERR_CAST() instead of open coding it
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 18 May 2017 07:34:31 +0000 (10:34 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 13 Jun 2017 15:24:21 +0000 (09:24 -0600)
It's a small cleanup to use ERR_CAST() here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c

index 561084ab387f3fd7c8ae3fa3e91c27d8329f7fe4..6a49485eb49da783a5d7e404de9b3806cbff2524 100644 (file)
@@ -382,7 +382,7 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group)
        if (IS_ERR(dev)) {
                vfio_free_group_minor(minor);
                vfio_group_unlock_and_free(group);
-               return (struct vfio_group *)dev; /* ERR_PTR */
+               return ERR_CAST(dev);
        }
 
        group->minor = minor;