]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: remove the non-useful else after a break in a if statement
authorKeren Sun <kerensun@google.com>
Fri, 15 Nov 2024 23:57:44 +0000 (15:57 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 14 Jan 2025 06:40:40 +0000 (22:40 -0800)
Remove the else block since there is already a break in the statement of
if (iter->oom_lock), just set iter->oom_lock true after the if block ends.

Link: https://lkml.kernel.org/r/20241115235744.1419580-4-kerensun@google.com
Signed-off-by: Keren Sun <kerensun@google.com>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol-v1.c

index c9fe524d341a59a3b5c1c509d85f2850bf46aee2..2be6b9112808cb39d2bd3397669f59cdb8cc358f 100644 (file)
@@ -1134,8 +1134,8 @@ static bool mem_cgroup_oom_trylock(struct mem_cgroup *memcg)
                        failed = iter;
                        mem_cgroup_iter_break(memcg, iter);
                        break;
-               } else
-                       iter->oom_lock = true;
+               }
+               iter->oom_lock = true;
        }
 
        if (failed) {