All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next v4] staging: fwserial: Switch to kfree_rcu() API
@ 2022-09-19  9:10 Shang XiaoJing
  2022-09-19  9:11 ` Greg KH
  2022-09-19  9:24 ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Shang XiaoJing @ 2022-09-19  9:10 UTC (permalink / raw)
  To: gregkh, andy.shevchenko, ilpo.jarvinen, linux-staging; +Cc: shangxiaojing

Instead of invoking a synchronize_rcu() to free a pointer after a grace
period, we can directly make use of a new API that does the same but in
a more efficient way.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
Changelog:
v3: the first version of the PATCH
v1: v3 resent as v1
v2: use kfree_rcu() instead of kvfree_rcu() for clarity
v4: resend v2 as v4 to avoid versioning confusion
---
 drivers/staging/fwserial/fwserial.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 81b06d88ed0d..8d2b4ed1f39e 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2117,8 +2117,7 @@ static void fwserial_remove_peer(struct fwtty_peer *peer)
 	if (port)
 		fwserial_release_port(port, true);
 
-	synchronize_rcu();
-	kfree(peer);
+	kfree_rcu(peer);
 }
 
 /**
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-20 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19  9:10 [PATCH -next v4] staging: fwserial: Switch to kfree_rcu() API Shang XiaoJing
2022-09-19  9:11 ` Greg KH
2022-09-19  9:43   ` shangxiaojing
2022-09-19 10:27     ` Dan Carpenter
2022-09-19 10:58       ` shangxiaojing
2022-09-20 12:04       ` shangxiaojing
2022-09-19  9:24 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.