Re: [PATCH v12 4/5] iommu/vt-d: pass pdev parameter for qi_check_fault() and refactor callers

From: Ethan Zhao
Date: Thu Feb 08 2024 - 21:09:10 EST



On 2/8/2024 3:15 PM, Dan Carpenter wrote:
Hi Ethan,

kernel test robot noticed the following build warnings:

url: https://github.com/intel-lab-lkp/linux/commits/Ethan-Zhao/PCI-make-pci_dev_is_disconnected-helper-public-for-other-drivers/20240129-115259
base: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
patch link: https://lore.kernel.org/r/20240129034924.817005-5-haifeng.zhao%40linux.intel.com
patch subject: [PATCH v12 4/5] iommu/vt-d: pass pdev parameter for qi_check_fault() and refactor callers
config: x86_64-randconfig-161-20240207 (https://download.01.org/0day-ci/archive/20240208/202402080321.n77hu71Y-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202402080321.n77hu71Y-lkp@xxxxxxxxx/

smatch warnings:
drivers/iommu/intel/dmar.c:1533 qi_flush_dev_iotlb() error: we previously assumed 'info->dev' could be null (see line 1533)

vim +1533 drivers/iommu/intel/dmar.c

20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1522 void qi_flush_dev_iotlb(struct intel_iommu *iommu,
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1523 struct device_domain_info *info, u64 addr,
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1524 unsigned int mask)
6ba6c3a4cacfd6 drivers/pci/dmar.c Yu Zhao 2009-05-18 1525 {
c830e699e08a6c drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1526 struct pci_dev *pdev = NULL;
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1527 u16 sid, qdep, pfsid;
6ba6c3a4cacfd6 drivers/pci/dmar.c Yu Zhao 2009-05-18 1528 struct qi_desc desc;
6ba6c3a4cacfd6 drivers/pci/dmar.c Yu Zhao 2009-05-18 1529
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1530 if (!info || !info->ats_enabled)
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1531 return;
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1532
c830e699e08a6c drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 @1533 if (info->dev || !dev_is_pci(info->dev))

Missing ! character. if (!info->dev

Got it, thanks.


c830e699e08a6c drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1534 return;
c830e699e08a6c drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1535
c830e699e08a6c drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1536 pdev = to_pci_dev(info->dev);
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1537 sid = info->bus << 8 | info->devfn;
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1538 qdep = info->ats_qdep;
20da7293134024 drivers/iommu/intel/dmar.c Ethan Zhao 2024-01-28 1539 pfsid = info->pfsid;