PM: EM: use kfree_rcu() to simplify the code

The callback function of call_rcu() just calls kfree(), so use
kfree_rcu() instead of call_rcu() + callback function.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20250218082021.2766-1-lirongqing@baidu.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Li RongQing 2025-02-18 16:20:21 +08:00 committed by Rafael J. Wysocki
parent a8e62726ac
commit 1618f635bd

View File

@ -161,14 +161,6 @@ static void em_debug_create_pd(struct device *dev) {}
static void em_debug_remove_pd(struct device *dev) {}
#endif
static void em_destroy_table_rcu(struct rcu_head *rp)
{
struct em_perf_table __rcu *table;
table = container_of(rp, struct em_perf_table, rcu);
kfree(table);
}
static void em_release_table_kref(struct kref *kref)
{
struct em_perf_table __rcu *table;
@ -176,7 +168,7 @@ static void em_release_table_kref(struct kref *kref)
/* It was the last owner of this table so we can free */
table = container_of(kref, struct em_perf_table, kref);
call_rcu(&table->rcu, em_destroy_table_rcu);
kfree_rcu(table, rcu);
}
/**