Re: [PATCH v3 10/16] iommu: introduce device fault report API

Jacob Pan
2017-12-08T21:21:08Z

On Tue, 5 Dec 2017 14:22:41 +0800
Lu Baolu <baolu.lu@linux.intel.com> wrote:

> > +int iommu_report_device_fault(struct device *dev, struct
> > iommu_fault_event *evt) +{
> > + /* we only report device fault if there is a handler
> > registered */
> > + if (!dev->iommu_param || !dev->iommu_param->fault_param ||
> > + !dev->iommu_param->fault_param->handler)
>
> Can this replaced by:
>
> if (!iommu_has_device_fault_handler(dev))
>
right, and under a lock too.

Thanks,

Jacob