> -----Original Message-----
> From: Christoph Hellwig [mailto:[email protected]]
> Sent: 21 April 2022 07:49
> To: Shameerali Kolothum Thodi <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; Linuxarm <[email protected]>;
> [email protected]; [email protected]; [email protected];
> [email protected]; wanghuiqiang <[email protected]>; Guohanjun
> (Hanjun Guo) <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]
> Subject: Re: [PATCH v10 4/9] ACPI/IORT: Add support to retrieve IORT RMR
> reserved regions
> 
[...]

> >  void generic_iommu_put_resv_regions(struct device *dev, struct list_head
> *list)
> >  {
> >     struct iommu_resv_region *entry, *next;
> >
> > -   list_for_each_entry_safe(entry, next, list, list)
> > +   list_for_each_entry_safe(entry, next, list, list) {
> > +           if (entry->resv_region_free_fw_data)
> > +                   entry->resv_region_free_fw_data(dev, entry);
> >             kfree(entry);
> 
> I'd move the kfree to the free callback if present.  This would also
> allow to hide the union from the common code entirely and use a
> container structure like:
> 
> struct iommu_iort_rmr_data {
>       struct iommu_resv_region rr;
> 
>       /* Stream IDs associated with IORT RMR entry */
>       const u32 *sids;
>       u32 num_sids;
> };

Ok. I will respin soon with the above changes.

Thanks,
Shameer 
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to