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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bdb0d6ebe90f080e2c9749506a622f22299da412.1648494330.git.christophe.jaillet@wanadoo.fr>
Date:   Mon, 28 Mar 2022 21:07:42 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     unlisted-recipients:; (no To-header on input)
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        linux-ia64@...r.kernel.org
Subject: [PATCH 2/2] ia64: topology: Slightly simplify code

cpu_cache_sysfs_exit() already clears '&all_cpu_cache_info[cpu].kobj'. So
there is no need to do it twice.

Remove the redundant memset() and slightly simplify code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
This patch is provided as-is and is not even compile tested. I don't have the
cross-building toolchain for that.
---
 arch/ia64/kernel/topology.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 6adb84f05cbb..df58df614873 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -387,12 +387,8 @@ static int cache_remove_dev(unsigned int cpu)
 	for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++)
 		kobject_put(&(LEAF_KOBJECT_PTR(cpu,i)->kobj));
 
-	if (all_cpu_cache_info[cpu].kobj.parent) {
+	if (all_cpu_cache_info[cpu].kobj.parent)
 		kobject_put(&all_cpu_cache_info[cpu].kobj);
-		memset(&all_cpu_cache_info[cpu].kobj,
-			0,
-			sizeof(struct kobject));
-	}
 
 	cpu_cache_sysfs_exit(cpu);
 
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ