lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 16 Sep 2022 21:35:35 +0800
From:   Xin Hao <xhao@...ux.alibaba.com>
To:     sj@...nel.org
Cc:     akpm@...ux-foundation.org, damon@...ts.linux.dev,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        xhao@...ux.alibaba.com
Subject: [PATCH] mm/damon/sysfs: more simplified code calls damon_target_has_pid()

This patch further simplifies the damon_target_has_pid() call and makes
the damon_sysfs_destroy_targets() look cleaner.

Fixes: 49fb890735ab (mm/damon/sysfs: avoid call damon_target_has_pid() repeatedly)
Signed-off-by: Xin Hao <xhao@...ux.alibaba.com>
Suggested-by: SeongJae Park <sj@...nel.org>
Reviewed-by: SeongJae Park <sj@...nel.org>
---
 mm/damon/sysfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index dc8dd56d6589..7692c706bcc5 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2132,10 +2132,7 @@ static int damon_sysfs_set_attrs(struct damon_ctx *ctx,
 static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
 {
 	struct damon_target *t, *next;
-	bool has_pid = false;
-
-	if (damon_target_has_pid(ctx))
-		has_pid = true;
+	bool has_pid = damon_target_has_pid(ctx);
 
 	damon_for_each_target_safe(t, next, ctx) {
 		if (has_pid)
-- 
2.31.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ