Re: [PATCH 3/3] iommu/vt-d: Apply SATC policy
From: Joerg Roedel
Date: Tue Feb 02 2021 - 14:38:53 EST
On Tue, Feb 02, 2021 at 12:40:57PM +0800, Lu Baolu wrote:
> + list_for_each_entry_rcu(satcu, &dmar_satc_units, list) {
> + satc = container_of(satcu->hdr, struct acpi_dmar_satc, header);
> + if (satc->segment == pci_domain_nr(dev->bus) && satcu->atc_required) {
You can safe a level of indentation and make this look nicer if you do:
if (satc->segment != pci_domain_nr(dev->bus) || !satcu->atc_required)
continue;
> + for_each_dev_scope(satcu->devices, satcu->devices_cnt, i, tmp)
> + if (to_pci_dev(tmp) == dev)
> + goto out;
> + }
> + }
> + ret = 0;
> +out:
> + rcu_read_unlock();
> + return ret;
> +}