Skip to contentSkip to conversation

epoll: cleanup: use RCU_INIT_POINTER when nulling

PATCH New Eric Wong 1 participant 1 message Mar 28, 2013 VFS

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 epoll: cleanup: use RCU_INIT_POINTER when nulling

It is always safe to use RCU_INIT_POINTER to NULL a pointer. This results in slightly smaller/faster code.

Cc Andrew Morton <[email protected]>

---
Andrew: Sorry for the noise and requiring these cleanups. Would you want a squashed commit with all my RCU+ws-related epoll changes to keep history cleaner? I will try to be more careful and require less followup patches in the future :x

 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
index dcf7906..1295d3a 100644
@@ -1207,7 +1207,7 @@ static noinline void ep_destroy_wakeup_source(struct epitem *epi)
 {
 	struct wakeup_source *ws = ep_wakeup_source(epi);
 
-	rcu_assign_pointer(epi->ws, NULL);
+	RCU_INIT_POINTER(epi->ws, NULL);
 
 	/*
 	 * wait for ep_pm_stay_awake_rcu to finish, synchronize_rcu is
Signature · 1 line
Eric Wong