Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

YueHaibing and committed by
Michael Ellerman
c312d14e bc75e543

+1 -9
+1 -9
arch/powerpc/platforms/powernv/pci-ioda-tce.c
··· 340 340 return -ENOMEM; 341 341 } 342 342 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 - 351 343 void pnv_pci_unlink_table_and_group(struct iommu_table *tbl, 352 344 struct iommu_table_group *table_group) 353 345 { ··· 355 363 list_for_each_entry_rcu(tgl, &tbl->it_group_list, next) { 356 364 if (tgl->table_group == table_group) { 357 365 list_del_rcu(&tgl->next); 358 - call_rcu(&tgl->rcu, pnv_iommu_table_group_link_free); 366 + kfree_rcu(tgl, rcu); 359 367 found = true; 360 368 break; 361 369 }