From: Maninder Singh Date: Tue, 3 Mar 2026 10:26:00 +0000 (+0530) Subject: mm/oom_kill.c: simpilfy rcu call with guard(rcu) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=909632714f687560627f3e8c21fb5f5180373afd;p=thirdparty%2Fkernel%2Flinux.git mm/oom_kill.c: simpilfy rcu call with guard(rcu) guard(rcu)() simplifies code readability and there is no need of extra goto labels. Thus replacing rcu_read_lock/unlock with guard(rcu)(). Link: https://lkml.kernel.org/r/20260303102600.105255-1-maninder1.s@samsung.com Signed-off-by: Maninder Singh Acked-by: Michal Hocko Reviewed-by: Dmitry Ilvokhin Acked-by: Shakeel Butt Cc: David Rientjes Signed-off-by: Andrew Morton --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 54b7a8fe51366..5f372f6e26fa3 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -135,19 +135,16 @@ struct task_struct *find_lock_task_mm(struct task_struct *p) { struct task_struct *t; - rcu_read_lock(); + guard(rcu)(); for_each_thread(p, t) { task_lock(t); if (likely(t->mm)) - goto found; + return t; task_unlock(t); } - t = NULL; -found: - rcu_read_unlock(); - return t; + return NULL; } /*