On 22.02.2022 12:02, Andrew Cooper wrote: > On 22/02/2022 10:54, Andrew Cooper wrote: >> On 22/02/2022 09:29, Jan Beulich wrote: >>> On 21.02.2022 19:03, Andrew Cooper wrote: >>>> @@ -106,7 +104,7 @@ int iommu_setup_hpet_msi(struct msi_desc *); >>>> static inline int iommu_adjust_irq_affinities(void) >>>> { >>>> return iommu_ops.adjust_irq_affinities >>>> - ? iommu_ops.adjust_irq_affinities() >>>> + ? iommu_call(iommu_ops, adjust_irq_affinities) >>> While this (and other instances below) is x86-only code, where - with >>> the removal of the #ifdef above - we now know the first argument is >>> always ignored, I think it would still better be of the correct type >>> (&iommu_ops). Perhaps the "(void)(ops)" in the macro definitions would >>> better become "ASSERT((ops) == &iommu_ops)", which would check both >>> type (compile time) and value (runtime). >> I'm happy to fold that change if you want. It ought to optimise out >> completely for being > > Bah - sent too early. "for being tautological."
It's tautological here, but not everywhere. But imo the ASSERT() is good to have anyway, i.e. even if it leaves traces elsewhere in debug builds. Jan