All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yi Liu <yi.l.liu@intel.com>, Kevin Tian <kevin.tian@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [yiliu1765-iommufd:wip/iommufd_pasid-20240830-notest-yet 22/22] drivers/iommu/iommufd/pasid.c:66:48: warning: passing argument 2 of 'iommufd_hwpt_replace_device' makes integer from pointer without a cast
Date: Sat, 31 Aug 2024 14:42:25 +0800	[thread overview]
Message-ID: <202408311451.s5HpbNeo-lkp@intel.com> (raw)

tree:   https://github.com/yiliu1765/iommufd.git wip/iommufd_pasid-20240830-notest-yet
head:   aa93c979a57a5a050175b1d62886d9eb31dc0a6c
commit: aa93c979a57a5a050175b1d62886d9eb31dc0a6c [22/22] iommufd: Support attach/replace hwpt per pasid
config: arc-randconfig-002-20240831 (https://download.01.org/0day-ci/archive/20240831/202408311451.s5HpbNeo-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408311451.s5HpbNeo-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/202408311451.s5HpbNeo-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/iommu/iommufd/pasid.c:4:
   include/linux/iommufd.h:30:33: error: unknown type name 'ioasid_t'
      30 |                                 ioasid_t pasid, u32 *pt_id);
         |                                 ^~~~~~~~
   include/linux/iommufd.h:32:34: error: unknown type name 'ioasid_t'
      32 |                                  ioasid_t pasid, u32 *pt_id);
         |                                  ^~~~~~~~
   include/linux/iommufd.h:33:63: error: unknown type name 'ioasid_t'
      33 | void iommufd_device_pasid_detach(struct iommufd_device *idev, ioasid_t pasid);
         |                                                               ^~~~~~~~
   drivers/iommu/iommufd/pasid.c: In function 'iommufd_device_pasid_do_replace':
   drivers/iommu/iommufd/pasid.c:66:42: error: passing argument 1 of 'iommufd_hwpt_replace_device' from incompatible pointer type [-Werror=incompatible-pointer-types]
      66 |         rc = iommufd_hwpt_replace_device(hwpt, idev, pasid, hwpt, curr);
         |                                          ^~~~
         |                                          |
         |                                          struct iommufd_hw_pagetable *
   In file included from drivers/iommu/iommufd/pasid.c:8:
   drivers/iommu/iommufd/iommufd_private.h:592:70: note: expected 'struct iommufd_device *' but argument is of type 'struct iommufd_hw_pagetable *'
     592 | static inline int iommufd_hwpt_replace_device(struct iommufd_device *idev,
         |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/iommu/iommufd/pasid.c:66:48: warning: passing argument 2 of 'iommufd_hwpt_replace_device' makes integer from pointer without a cast [-Wint-conversion]
      66 |         rc = iommufd_hwpt_replace_device(hwpt, idev, pasid, hwpt, curr);
         |                                                ^~~~
         |                                                |
         |                                                struct iommufd_device *
   drivers/iommu/iommufd/iommufd_private.h:593:56: note: expected 'ioasid_t' {aka 'unsigned int'} but argument is of type 'struct iommufd_device *'
     593 |                                               ioasid_t pasid,
         |                                               ~~~~~~~~~^~~~~
>> drivers/iommu/iommufd/pasid.c:66:54: warning: passing argument 3 of 'iommufd_hwpt_replace_device' makes pointer from integer without a cast [-Wint-conversion]
      66 |         rc = iommufd_hwpt_replace_device(hwpt, idev, pasid, hwpt, curr);
         |                                                      ^~~~~
         |                                                      |
         |                                                      ioasid_t {aka unsigned int}
   drivers/iommu/iommufd/iommufd_private.h:594:76: note: expected 'struct iommufd_hw_pagetable *' but argument is of type 'ioasid_t' {aka 'unsigned int'}
     594 |                                               struct iommufd_hw_pagetable *hwpt,
         |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/iommu/iommufd/pasid.c:66:14: error: too many arguments to function 'iommufd_hwpt_replace_device'
      66 |         rc = iommufd_hwpt_replace_device(hwpt, idev, pasid, hwpt, curr);
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/iommufd/iommufd_private.h:592:19: note: declared here
     592 | static inline int iommufd_hwpt_replace_device(struct iommufd_device *idev,
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/iommufd/pasid.c: At top level:
   drivers/iommu/iommufd/pasid.c:98:5: warning: no previous prototype for 'iommufd_device_pasid_attach' [-Wmissing-prototypes]
      98 | int iommufd_device_pasid_attach(struct iommufd_device *idev,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/iommufd/pasid.c:126:5: warning: no previous prototype for 'iommufd_device_pasid_replace' [-Wmissing-prototypes]
     126 | int iommufd_device_pasid_replace(struct iommufd_device *idev,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/iommufd/pasid.c:147:6: warning: no previous prototype for 'iommufd_device_pasid_detach' [-Wmissing-prototypes]
     147 | void iommufd_device_pasid_detach(struct iommufd_device *idev, ioasid_t pasid)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/iommufd_hwpt_replace_device +66 drivers/iommu/iommufd/pasid.c

    39	
    40	struct iommufd_hw_pagetable *
    41	iommufd_device_pasid_do_replace(struct iommufd_device *idev, ioasid_t pasid,
    42					struct iommufd_hw_pagetable *hwpt)
    43	{
    44		void *curr;
    45		int rc;
    46	
    47		refcount_inc(&hwpt->obj.users);
    48		curr = xa_store(&idev->pasid_hwpts, pasid, hwpt, GFP_KERNEL);
    49		rc = xa_err(curr);
    50		if (rc)
    51			goto out_put_hwpt;
    52	
    53		if (!curr) {
    54			xa_erase(&idev->pasid_hwpts, pasid);
    55			rc = -EINVAL;
    56			goto out_put_hwpt;
    57		}
    58	
    59		if (curr == hwpt)
    60			goto out_put_hwpt;
    61	
    62		/*
    63		 * After replacement, the reference on the old hwpt is retained
    64		 * in this thread as caller would free it.
    65		 */
  > 66		rc = iommufd_hwpt_replace_device(hwpt, idev, pasid, hwpt, curr);
    67		if (rc) {
    68			WARN_ON(xa_err(xa_store(&idev->pasid_hwpts, pasid,
    69						curr, GFP_KERNEL)));
    70			goto out_put_hwpt;
    71		}
    72	
    73		/* Caller must destroy old_hwpt */
    74		return curr;
    75	
    76	out_put_hwpt:
    77		refcount_dec(&hwpt->obj.users);
    78		return ERR_PTR(rc);
    79	}
    80	

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

                 reply	other threads:[~2024-08-31  6:42 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=202408311451.s5HpbNeo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yi.l.liu@intel.com \
    /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 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.