* [yiliu1765-iommufd:wip/iommufd_pasid 67/73] drivers/iommu/iommufd/pasid.c:29:1-3: WARNING: possible condition with no effect (if == else)
@ 2023-07-14 3:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-07-14 3:16 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Yi Liu <yi.l.liu@intel.com>
TO: Kevin Tian <kevin.tian@intel.com>
tree: https://github.com/yiliu1765/iommufd.git wip/iommufd_pasid
head: e3941047a07be80cb3b87129cb372c1e6e7f4ced
commit: 0fb50342800a867a8e56866fddd1f3d0752c45a9 [67/73] iommufd: Allow attach/replace hwpt per pasid
:::::: branch date: 14 hours ago
:::::: commit date: 19 hours ago
config: arc-randconfig-r061-20230713 (https://download.01.org/0day-ci/archive/20230714/202307141101.6mFGzFS2-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230714/202307141101.6mFGzFS2-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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202307141101.6mFGzFS2-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/iommu/iommufd/pasid.c:29:1-3: WARNING: possible condition with no effect (if == else)
vim +29 drivers/iommu/iommufd/pasid.c
0fb50342800a86 Kevin Tian 2023-05-22 9
0fb50342800a86 Kevin Tian 2023-05-22 10 static int __iommufd_device_pasid_do_attach(struct iommufd_device *idev,
0fb50342800a86 Kevin Tian 2023-05-22 11 u32 pasid,
0fb50342800a86 Kevin Tian 2023-05-22 12 struct iommufd_hw_pagetable *hwpt,
0fb50342800a86 Kevin Tian 2023-05-22 13 bool replace)
0fb50342800a86 Kevin Tian 2023-05-22 14 {
0fb50342800a86 Kevin Tian 2023-05-22 15 int rc;
0fb50342800a86 Kevin Tian 2023-05-22 16
0fb50342800a86 Kevin Tian 2023-05-22 17 /*
0fb50342800a86 Kevin Tian 2023-05-22 18 * Try to upgrade the domain we have. This is also required for
0fb50342800a86 Kevin Tian 2023-05-22 19 * pasid attach since pasid only matters for identifying a hwpt
0fb50342800a86 Kevin Tian 2023-05-22 20 * while cache coherency is about memory access semantics post
0fb50342800a86 Kevin Tian 2023-05-22 21 * walking hwpt.
0fb50342800a86 Kevin Tian 2023-05-22 22 */
0fb50342800a86 Kevin Tian 2023-05-22 23 if (idev->enforce_cache_coherency) {
0fb50342800a86 Kevin Tian 2023-05-22 24 rc = iommufd_hw_pagetable_enforce_cc(hwpt);
0fb50342800a86 Kevin Tian 2023-05-22 25 if (rc)
0fb50342800a86 Kevin Tian 2023-05-22 26 return rc;
0fb50342800a86 Kevin Tian 2023-05-22 27 }
0fb50342800a86 Kevin Tian 2023-05-22 28
0fb50342800a86 Kevin Tian 2023-05-22 @29 if (!replace)
0fb50342800a86 Kevin Tian 2023-05-22 30 rc = iommu_attach_device_pasid(hwpt->domain, idev->dev, pasid);
0fb50342800a86 Kevin Tian 2023-05-22 31 else
0fb50342800a86 Kevin Tian 2023-05-22 32 /* FIXEME: need a pasid replace IOMMU API */
0fb50342800a86 Kevin Tian 2023-05-22 33 rc = iommu_attach_device_pasid(hwpt->domain, idev->dev, pasid);
0fb50342800a86 Kevin Tian 2023-05-22 34 if (rc)
0fb50342800a86 Kevin Tian 2023-05-22 35 return rc;
0fb50342800a86 Kevin Tian 2023-05-22 36
0fb50342800a86 Kevin Tian 2023-05-22 37 xa_store(&idev->pasid_hwpts, pasid, hwpt, GFP_KERNEL);
0fb50342800a86 Kevin Tian 2023-05-22 38 refcount_inc(&hwpt->obj.users);
0fb50342800a86 Kevin Tian 2023-05-22 39 return 0;
0fb50342800a86 Kevin Tian 2023-05-22 40 }
0fb50342800a86 Kevin Tian 2023-05-22 41
--
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-07-14 3:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 3:16 [yiliu1765-iommufd:wip/iommufd_pasid 67/73] drivers/iommu/iommufd/pasid.c:29:1-3: WARNING: possible condition with no effect (if == else) 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.