diff mbox series

[3/3] mm: remove the non-useful else after a break in a if statement

Message ID 20241115235744.1419580-4-kerensun@google.com (mailing list archive)
State New
Headers show
Series mm: fix format issues and param types | expand

Commit Message

Keren Sun Nov. 15, 2024, 11:57 p.m. UTC
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.

Signed-off-by: Keren Sun <kerensun@google.com>
---
 mm/memcontrol-v1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Roman Gushchin Nov. 18, 2024, 4:56 p.m. UTC | #1
On Fri, Nov 15, 2024 at 03:57:44PM -0800, Keren Sun wrote:
> 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.
> 
> Signed-off-by: Keren Sun <kerensun@google.com>

Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!
diff mbox series

Patch

diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
index 4cbbced0c8a1..423c861acdd8 100644
--- a/mm/memcontrol-v1.c
+++ b/mm/memcontrol-v1.c
@@ -1148,8 +1148,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) {