mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [jgunthorpe:iommufd 19/20] drivers/iommu/iommufd/device.c:58: warning: expecting prototype for iommufd_bind_device(). Prototype was for iommufd_bind_pci_device() instead
Date: Sat, 13 Nov 2021 10:55:30 +0800	[thread overview]
Message-ID: <202111131025.FygXFguV-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3677 bytes --]

tree:   https://github.com/jgunthorpe/linux iommufd
head:   17bcea24295e34cf0f061dd3bdbb747b63a1933e
commit: a262a567f972f2a4910e3b85bb5620f981dd8229 [19/20] iommufd: Add kAPI toward external drivers
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/jgunthorpe/linux/commit/a262a567f972f2a4910e3b85bb5620f981dd8229
        git remote add jgunthorpe https://github.com/jgunthorpe/linux
        git fetch --no-tags jgunthorpe iommufd
        git checkout a262a567f972f2a4910e3b85bb5620f981dd8229
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iommu/iommufd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/iommu/iommufd/device.c:58: warning: Function parameter or member 'pdev' not described in 'iommufd_bind_pci_device'
>> drivers/iommu/iommufd/device.c:58: warning: expecting prototype for iommufd_bind_device(). Prototype was for iommufd_bind_pci_device() instead


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

    38	
    39	/**
    40	 * iommufd_bind_device - Bind a physical device marked by a device
    41	 *			 cookie to an iommu fd.
    42	 * @fd: iommufd file descriptor.
    43	 * @dev: Pointer to a physical device struct.
    44	 * @id: ID number to return to userspace for this device
    45	 * @dev_cookie: A cookie that is returned to userspace in events
    46	 *
    47	 * A successful bind establishes a security context for the device and returns
    48	 * struct iommufd_device pointer. Otherwise returns error pointer. An external
    49	 * driver must call this function before touching the pci_dev in any way. Until
    50	 * it returns the pci_dev could be subject to external manipulation via PCI P2P.
    51	 *
    52	 * Binding a PCI device places the entire base RID under iommufd control.
    53	 *
    54	 * The caller must undo this with iommufd_unbind_device()
    55	 */
    56	struct iommufd_device *iommufd_bind_pci_device(int fd, struct pci_dev *pdev,
    57						       u32 *id, u64 dev_cookie)
  > 58	{
    59		struct iommufd_device *idev;
    60		struct iommufd_ctx *ictx;
    61		int rc;
    62	
    63		ictx = iommufd_fget(fd);
    64		if (!ictx)
    65			return ERR_PTR(-EINVAL);
    66	
    67		rc = iommu_device_set_dma_owner(&pdev->dev, DMA_OWNER_USER, ictx->filp);
    68		if (rc)
    69			goto out_file_put;
    70	
    71		idev = iommufd_object_alloc(ictx, idev, IOMMUFD_OBJ_DEVICE);
    72		if (IS_ERR(idev)) {
    73			rc = PTR_ERR(idev);
    74			goto out_release_owner;
    75		}
    76		idev->dev = &pdev->dev;
    77		idev->dev_cookie = dev_cookie;
    78		/* The calling driver is a user until iommufd_unbind_device() */
    79		refcount_inc(&idev->obj.users);
    80	
    81		/*
    82		 * If the caller fails after this success it must call
    83		 * iommufd_unbind_device() which is safe since we hold this refcount.
    84		 * This also means the device is a leaf in the graph and no other object
    85		 * can take a reference on it.
    86		 */
    87		iommufd_object_finalize(ictx, &idev->obj);
    88		*id = idev->obj.id;
    89		return idev;
    90	
    91	out_release_owner:
    92		iommu_device_release_dma_owner(&pdev->dev, DMA_OWNER_USER);
    93	out_file_put:
    94		fput(ictx->filp);
    95		return ERR_PTR(rc);
    96	}
    97	EXPORT_SYMBOL_GPL(iommufd_bind_pci_device);
    98	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66540 bytes --]

                 reply	other threads:[~2021-11-13  2:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111131025.FygXFguV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jgg@nvidia.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome