Commit c312d14e authored by YueHaibing's avatar YueHaibing Committed by Michael Ellerman

powerpc/powernv/ioda: using kfree_rcu() to simplify the code

The callback function of call_rcu() just calls a kfree(), so we
can use kfree_rcu() instead of call_rcu() + callback function.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190711141818.18044-1-yuehaibing@huawei.com
parent bc75e543
......@@ -340,14 +340,6 @@ long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
return -ENOMEM;
}
static void pnv_iommu_table_group_link_free(struct rcu_head *head)
{
struct iommu_table_group_link *tgl = container_of(head,
struct iommu_table_group_link, rcu);
kfree(tgl);
}
void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
struct iommu_table_group *table_group)
{
......@@ -363,7 +355,7 @@ void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
list_for_each_entry_rcu(tgl, &tbl->it_group_list, next) {
if (tgl->table_group == table_group) {
list_del_rcu(&tgl->next);
call_rcu(&tgl->rcu, pnv_iommu_table_group_link_free);
kfree_rcu(tgl, rcu);
found = true;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment