Skip to content

Commit c312d14

Browse files
YueHaibingmpe
authored andcommitted
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: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190711141818.18044-1-yuehaibing@huawei.com
1 parent bc75e54 commit c312d14

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

arch/powerpc/platforms/powernv/pci-ioda-tce.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,6 @@ long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
340340
return -ENOMEM;
341341
}
342342

343-
static void pnv_iommu_table_group_link_free(struct rcu_head *head)
344-
{
345-
struct iommu_table_group_link *tgl = container_of(head,
346-
struct iommu_table_group_link, rcu);
347-
348-
kfree(tgl);
349-
}
350-
351343
void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
352344
struct iommu_table_group *table_group)
353345
{
@@ -363,7 +355,7 @@ void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
363355
list_for_each_entry_rcu(tgl, &tbl->it_group_list, next) {
364356
if (tgl->table_group == table_group) {
365357
list_del_rcu(&tgl->next);
366-
call_rcu(&tgl->rcu, pnv_iommu_table_group_link_free);
358+
kfree_rcu(tgl, rcu);
367359
found = true;
368360
break;
369361
}

0 commit comments

Comments
 (0)