[PATCH v10 4/9] ACPI/IORT: Add support to retrieve IORT RMR reserved regions
Shameerali Kolothum Thodi
shameerali.kolothum.thodi at huawei.com
Thu Apr 21 07:50:03 PDT 2022
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch at infradead.org]
> Sent: 21 April 2022 07:49
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi at huawei.com>
> Cc: linux-arm-kernel at lists.infradead.org; linux-acpi at vger.kernel.org;
> iommu at lists.linux-foundation.org; Linuxarm <linuxarm at huawei.com>;
> lorenzo.pieralisi at arm.com; joro at 8bytes.org; robin.murphy at arm.com;
> will at kernel.org; wanghuiqiang <wanghuiqiang at huawei.com>; Guohanjun
> (Hanjun Guo) <guohanjun at huawei.com>; steven.price at arm.com;
> Sami.Mujawar at arm.com; jon at solid-run.com; eric.auger at redhat.com;
> laurentiu.tudor at nxp.com; hch at infradead.org
> 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
More information about the linux-arm-kernel
mailing list