diff mbox series

[3/4] net: openvswitch: convert call_rcu(dp_meter_instance_free_rcu) to kvfree_rcu()

Message ID 20241120064716.3361211-4-ranxiaokai627@163.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series Convert some simple call_rcu() to kfree_rcu()/kvfree_rcu() | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 4 maintainers not CCed: kuba@kernel.org edumazet@google.com horms@kernel.org pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 22 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-20--15-00 (tests: 789)

Commit Message

Ran Xiaokai Nov. 20, 2024, 6:47 a.m. UTC
From: Ran Xiaokai <ran.xiaokai@zte.com.cn>

The rcu callback dp_meter_instance_free_rcu() simply calls kvfree().
It's better to directly call kvfree_rcu().

Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>
---
 net/openvswitch/meter.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index cc08e0403909..d99efb9ce1a0 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -83,14 +83,6 @@  static void dp_meter_instance_free(struct dp_meter_instance *ti)
 	kvfree(ti);
 }
 
-static void dp_meter_instance_free_rcu(struct rcu_head *rcu)
-{
-	struct dp_meter_instance *ti;
-
-	ti = container_of(rcu, struct dp_meter_instance, rcu);
-	kvfree(ti);
-}
-
 static int
 dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size)
 {
@@ -108,7 +100,7 @@  dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size)
 			new_ti->dp_meters[i] = ti->dp_meters[i];
 
 	rcu_assign_pointer(tbl->ti, new_ti);
-	call_rcu(&ti->rcu, dp_meter_instance_free_rcu);
+	kvfree_rcu(ti, rcu);
 
 	return 0;
 }