All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	Marc Zyngier <maz@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Will Deacon <will@kernel.org>,
	Bharat Bhushan <bharat.bhushan@nxp.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Eric Auger <eric.auger@redhat.com>,
	Eric Farman <farman@linux.ibm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH iommufd v3 2/9] iommu: Add iommu_group_has_isolated_msi()
Date: Wed, 11 Jan 2023 16:19:37 -0400	[thread overview]
Message-ID: <Y78Z2TZajTrS1cWg@nvidia.com> (raw)
In-Reply-To: <87eds1hr2h.ffs@tglx>

On Wed, Jan 11, 2023 at 07:19:34PM +0100, Thomas Gleixner wrote:
> 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:

Sure, though this is all undone by the last patch which does make it
visually a single statement:

 	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);
+		ret &= msi_device_has_isolated_msi(group_dev->dev);

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

Ah, there are so many different opinions on that!

I got everything else, I'll stick this in linux-next via the iommufd
tree so more bots can check it - if anyone else has remarks I can make
a v4

Thanks,
Jason

  reply	other threads:[~2023-01-11 20:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 19:33 [PATCH iommufd v3 0/9] Remove IOMMU_CAP_INTR_REMAP Jason Gunthorpe
2023-01-05 19:33 ` [PATCH iommufd v3 1/9] irq: Add msi_device_has_isolated_msi() Jason Gunthorpe
2023-01-11 18:14   ` Thomas Gleixner
2023-01-05 19:33 ` [PATCH iommufd v3 2/9] iommu: Add iommu_group_has_isolated_msi() Jason Gunthorpe
2023-01-06 11:28   ` Baolu Lu
2023-01-06 13:12     ` Jason Gunthorpe
2023-01-07  2:19       ` Baolu Lu
2023-01-11 18:19   ` Thomas Gleixner
2023-01-11 20:19     ` Jason Gunthorpe [this message]
2023-01-05 19:33 ` [PATCH iommufd v3 3/9] vfio/type1: Convert to iommu_group_has_isolated_msi() Jason Gunthorpe
2023-01-06 11:34   ` Baolu Lu
2023-01-05 19:33 ` [PATCH iommufd v3 4/9] iommufd: Convert to msi_device_has_isolated_msi() Jason Gunthorpe
2023-01-06 11:36   ` Baolu Lu
2023-01-05 19:33 ` [PATCH iommufd v3 5/9] irq: Remove unused irq_domain_check_msi_remap() code Jason Gunthorpe
2023-01-11 18:22   ` Thomas Gleixner
2023-01-05 19:33 ` [PATCH iommufd v3 6/9] irq: Rename IRQ_DOMAIN_MSI_REMAP to IRQ_DOMAIN_ISOLATED_MSI Jason Gunthorpe
2023-01-11 18:23   ` Thomas Gleixner
2023-01-05 19:33 ` [PATCH iommufd v3 7/9] iommu/x86: Replace IOMMU_CAP_INTR_REMAP with IRQ_DOMAIN_FLAG_ISOLATED_MSI Jason Gunthorpe
2023-01-06 11:42   ` Baolu Lu
2023-01-11 18:23   ` Thomas Gleixner
2023-01-05 19:33 ` [PATCH iommufd v3 8/9] irq/s390: Add arch_is_isolated_msi() for s390 Jason Gunthorpe
2023-01-05 19:33 ` [PATCH iommufd v3 9/9] iommu: Remove IOMMU_CAP_INTR_REMAP Jason Gunthorpe
2023-01-06 11:45   ` Baolu Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y78Z2TZajTrS1cWg@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=borntraeger@de.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=eric.auger@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=maz@kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tomasz.nowicki@caviumnetworks.com \
    --cc=will.deacon@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.