[PATCH v2 1/2] iommu/arm-smmu-v3: Do not bother impl_ops if IOMMU_VIOMMU_TYPE_ARM_SMMUV3
Nicolin Chen
nicolinc at nvidia.com
Mon Jul 21 12:40:17 PDT 2025
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 at kernel.org>
Ah, it only compares one bit, so I think "!=" would be nicer.
Will quickly respin a v3.
Thanks
Nicolin
More information about the linux-arm-kernel
mailing list