Skip to content

Commit f3fe7e1

Browse files
wei-w-wangjoergroedel
authored andcommitted
iommu/vt-d: Change dmar_ats_supported() to return boolean
According to "Function return values and names" in coding-style.rst, the dmar_ats_supported() function should return a boolean instead of an integer. Also, rename "ret" to "supported" to be more straightforward. Signed-off-by: Wei Wang <wei.w.wang@intel.com> Reviewed-by: Yi Liu <yi.l.liu@intel.com> Link: https://lore.kernel.org/r/20250509140021.4029303-3-wei.w.wang@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 3df2ebc commit f3fe7e1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,15 +2702,16 @@ static struct dmar_satc_unit *dmar_find_matched_satc_unit(struct pci_dev *dev)
27022702
return satcu;
27032703
}
27042704

2705-
static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu)
2705+
static bool dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu)
27062706
{
2707-
int i, ret = 1;
2708-
struct pci_bus *bus;
27092707
struct pci_dev *bridge = NULL;
2710-
struct device *tmp;
2711-
struct acpi_dmar_atsr *atsr;
27122708
struct dmar_atsr_unit *atsru;
27132709
struct dmar_satc_unit *satcu;
2710+
struct acpi_dmar_atsr *atsr;
2711+
bool supported = true;
2712+
struct pci_bus *bus;
2713+
struct device *tmp;
2714+
int i;
27142715

27152716
dev = pci_physfn(dev);
27162717
satcu = dmar_find_matched_satc_unit(dev);
@@ -2728,11 +2729,11 @@ static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu)
27282729
bridge = bus->self;
27292730
/* If it's an integrated device, allow ATS */
27302731
if (!bridge)
2731-
return 1;
2732+
return true;
27322733
/* Connected via non-PCIe: no ATS */
27332734
if (!pci_is_pcie(bridge) ||
27342735
pci_pcie_type(bridge) == PCI_EXP_TYPE_PCI_BRIDGE)
2735-
return 0;
2736+
return false;
27362737
/* If we found the root port, look it up in the ATSR */
27372738
if (pci_pcie_type(bridge) == PCI_EXP_TYPE_ROOT_PORT)
27382739
break;
@@ -2751,11 +2752,11 @@ static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu)
27512752
if (atsru->include_all)
27522753
goto out;
27532754
}
2754-
ret = 0;
2755+
supported = false;
27552756
out:
27562757
rcu_read_unlock();
27572758

2758-
return ret;
2759+
return supported;
27592760
}
27602761

27612762
int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)

0 commit comments

Comments
 (0)