Re: [PATCH v2 1/2] iommu/arm-smmu-v3: Do not bother impl_ops if IOMMU_VIOMMU_TYPE_ARM_SMMUV3

From: Nicolin Chen
Date: Mon Jul 21 2025 - 15:40:54 EST


On Mon, Jul 21, 2025 at 08:23:36PM +0100, Will Deacon wrote:
> On Mon, Jul 21, 2025 at 12:12:35PM -0700, Nicolin Chen wrote:
> > + ops = new_smmu->impl_ops;
> > + if (ops) {
> > + /* vsmmu_size and vsmmu_init ops must be paired */
> > + if (WARN_ON(!ops->vsmmu_size ^ !ops->vsmmu_init)) {
> > + ret = -EINVAL;
> > + goto err_remove;
> > + }
>
> I suppose that could be != instead of ^ to avoid mixing up logical and
> arithmetic operators, but it does the trick either way so:
>
> Acked-by: Will Deacon <will@xxxxxxxxxx>

Ah, it only compares one bit, so I think "!=" would be nicer.

Will quickly respin a v3.

Thanks
Nicolin