Re: [PATCH 1/2] iommufd/device: Drop enforce_cache_coherency in iommufd_device_do_replace

From: Nicolin Chen
Date: Sun Oct 22 2023 - 20:30:44 EST


On Sat, Oct 21, 2023 at 09:25:18AM +0800, Baolu Lu wrote:
> > @@ -465,6 +455,8 @@ iommufd_device_do_replace(struct iommufd_device *idev,
> >
> > igroup->hwpt = hwpt;
> >
> > + list_for_each_entry(cur, &igroup->device_list, group_item)
> > + num_devices++;
>
> Minor: How about using list_count_nodes()?

That's better I think. Replaced with:

+ num_devices = list_count_nodes(&igroup->device_list);

> > /*
> > * Move the refcounts held by the device_list to the new hwpt. Retain a
> > * refcount for this thread as the caller will free it.
>
> Either way,
>
> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>

Thanks!
Nic