All of lore.kernel.org
 help / color / mirror / Atom feed
* [yiliu1765-iommufd:iommufd-v5.19-rc5 25/104] drivers/iommu/iommufd/device.c:58: warning: Function parameter or member 'dev' not described in 'iommufd_bind_device'
@ 2023-11-09 23:22 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-09 23:22 UTC (permalink / raw)
  To: Yi Liu, Kevin Tian; +Cc: oe-kbuild-all

tree:   https://github.com/yiliu1765/iommufd.git iommufd-v5.19-rc5
head:   f200d9a1de755f3bb98e21535e22b9adf6ba83f7
commit: 6f915f4df4ae494e0d6d26991ddc8ebb672f9101 [25/104] iommufd: Add kAPI toward external drivers
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231110/202311100722.1jgTOjmO-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231110/202311100722.1jgTOjmO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311100722.1jgTOjmO-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/iommu/iommufd/device.c:58: warning: Function parameter or member 'dev' not described in 'iommufd_bind_device'
>> drivers/iommu/iommufd/device.c:58: warning: Excess function parameter 'pdev' description in 'iommufd_bind_device'


vim +58 drivers/iommu/iommufd/device.c

    40	
    41	/**
    42	 * iommufd_bind_device - Bind a physical device to an iommu fd
    43	 * @fd: iommufd file descriptor.
    44	 * @pdev: Pointer to a physical PCI device struct
    45	 * @id: Output ID number to return to userspace for this device
    46	 *
    47	 * A successful bind establishes an ownership over the device and returns
    48	 * struct iommufd_device pointer, otherwise returns error pointer.
    49	 *
    50	 * A driver using this API must set driver_managed_dma and must not touch
    51	 * the device until this routine succeeds and establishes ownership.
    52	 *
    53	 * Binding a PCI device places the entire RID under iommufd control.
    54	 *
    55	 * The caller must undo this with iommufd_unbind_device()
    56	 */
    57	struct iommufd_device *iommufd_bind_device(int fd, struct device *dev, u32 *id)
  > 58	{
    59		struct iommufd_device *idev;
    60		struct iommufd_ctx *ictx;
    61		struct iommu_group *group;
    62		int rc;
    63	
    64	       /*
    65	        * iommufd always sets IOMMU_CACHE because we offer no way for userspace
    66	        * to restore cache coherency.
    67	        */
    68	       if (!iommu_capable(dev->bus, IOMMU_CAP_CACHE_COHERENCY))
    69			return ERR_PTR(-EINVAL);
    70	
    71		ictx = iommufd_fget(fd);
    72		if (!ictx)
    73			return ERR_PTR(-EINVAL);
    74	
    75		group = iommu_group_get(dev);
    76		if (!group) {
    77			rc = -ENODEV;
    78			goto out_file_put;
    79		}
    80	
    81		/*
    82		 * FIXME: Use a device-centric iommu api and this won't work with
    83		 * multi-device groups
    84		 */
    85		rc = iommu_group_claim_dma_owner(group, ictx->filp);
    86		if (rc)
    87			goto out_group_put;
    88	
    89		idev = iommufd_object_alloc(ictx, idev, IOMMUFD_OBJ_DEVICE);
    90		if (IS_ERR(idev)) {
    91			rc = PTR_ERR(idev);
    92			goto out_release_owner;
    93		}
    94		idev->ictx = ictx;
    95		idev->dev = dev;
    96		/* The calling driver is a user until iommufd_unbind_device() */
    97		refcount_inc(&idev->obj.users);
    98		/* group refcount moves into iommufd_device */
    99		idev->group = group;
   100	
   101		/*
   102		 * If the caller fails after this success it must call
   103		 * iommufd_unbind_device() which is safe since we hold this refcount.
   104		 * This also means the device is a leaf in the graph and no other object
   105		 * can take a reference on it.
   106		 */
   107		iommufd_object_finalize(ictx, &idev->obj);
   108		*id = idev->obj.id;
   109		return idev;
   110	
   111	out_release_owner:
   112		iommu_group_release_dma_owner(group);
   113	out_group_put:
   114		iommu_group_put(group);
   115	out_file_put:
   116		fput(ictx->filp);
   117		return ERR_PTR(rc);
   118	}
   119	EXPORT_SYMBOL_GPL(iommufd_bind_device);
   120	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-09 23:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 23:22 [yiliu1765-iommufd:iommufd-v5.19-rc5 25/104] drivers/iommu/iommufd/device.c:58: warning: Function parameter or member 'dev' not described in 'iommufd_bind_device' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.