Re: [PATCH iommufd v3 2/9] iommu: Add iommu_group_has_isolated_msi()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 05 2023 at 15:33, Jason Gunthorpe wrote:
> +
> +	mutex_lock(&group->mutex);
> +	list_for_each_entry(group_dev, &group->devices, list)
> +		ret &= msi_device_has_isolated_msi(group_dev->dev) ||
> +		       device_iommu_capable(group_dev->dev,
> +					    IOMMU_CAP_INTR_REMAP);

Nit. This really wants brackets even if they are not required by the
language. Why?

Brackets can be omitted for a single line statement in the loop/if path,
but this

> +		ret &= msi_device_has_isolated_msi(group_dev->dev) ||
> +		       device_iommu_capable(group_dev->dev,
> +					    IOMMU_CAP_INTR_REMAP);

is visually a multi line statement. So having brackets makes visual
parsing of this construct way clearer:

	list_for_each_entry(group_dev, &group->devices, list) {
		ret &= msi_device_has_isolated_msi(group_dev->dev) ||
		       device_iommu_capable(group_dev->dev, IOMMU_CAP_INTR_REMAP);
	}

Also get rid of that extra line break. We lifted the 80 characters line
length quite some while ago and made it 100.

Thanks,

        tglx



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux