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

From: Jacob Pan
Date: Fri Dec 08 2017 - 16:21:11 EST


On Tue, 5 Dec 2017 14:22:41 +0800
Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx> 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