Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491150

[PATCH 2/2] x86/RAS/mce_amd_inj: Remove debugfs dir recursively on exit

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject [PATCH 2/2] x86/RAS/mce_amd_inj: Remove debugfs dir recursively on exit
Date 2016-09-26 10:40 +0200
Message-ID <slzCa-1yg-21@gated-at.bofh.it> (permalink)
References <slzCa-1yg-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Borislav Petkov <bp@suse.de>

Simplify exit_mce_inject() by using debugfs_remove_recursive() and do
away with the noodling over the dentry elements.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/ras/mce_amd_inj.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/ras/mce_amd_inj.c b/arch/x86/ras/mce_amd_inj.c
index 20b227f63407..1ac76479c266 100644
--- a/arch/x86/ras/mce_amd_inj.c
+++ b/arch/x86/ras/mce_amd_inj.c
@@ -475,15 +475,11 @@ err_dfs_add:
 
 static void __exit exit_mce_inject(void)
 {
-	int i;
 
-	for (i = 0; i < ARRAY_SIZE(dfs_fls); i++)
-		debugfs_remove(dfs_fls[i].d);
+	debugfs_remove_recursive(dfs_inj);
+	dfs_inj = NULL;
 
 	memset(&dfs_fls, 0, sizeof(dfs_fls));
-
-	debugfs_remove(dfs_inj);
-	dfs_inj = NULL;
 }
 module_init(init_mce_inject);
 module_exit(exit_mce_inject);
-- 
2.10.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] x86/ras: Two more for 4.9 Borislav Petkov <bp@alien8.de> - 2016-09-26 10:40 +0200
  [PATCH 2/2] x86/RAS/mce_amd_inj: Remove debugfs dir recursively on exit Borislav Petkov <bp@alien8.de> - 2016-09-26 10:40 +0200
    [tip:ras/core] x86/RAS/mce_amd_inj: Remove debugfs dir recursively  on exit tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-09-26 18:40 +0200

csiph-web