Skip to contentSkip to conversation

x86/pat: trivial: don't create debugfs for memtype if pat is disabled

PATCH In review Xiaotian Feng 1 participant 2 messages Nov 26, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pat: trivial: don't create debugfs for memtype if pat is disabled

If pat is disabled (boot with nopat), there's no need to create debugfs for it, it's empty all the time.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Suresh Siddha <[email protected]>
Cc Venkatesh Pallipadi <[email protected]>
---
 arch/x86/mm/pat.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/mm/pat.c +3 -2
index 01fc043..c37fd51 100644
@@ -1014,8 +1014,9 @@ static const struct file_operations memtype_fops = {
 
 static int __init pat_memtype_list_init(void)
 {
-	debugfs_create_file("pat_memtype_list", S_IRUSR, arch_debugfs_dir,
-				NULL, &memtype_fops);
+	if (pat_enabled)
+		debugfs_create_file("pat_memtype_list", S_IRUSR,
+					arch_debugfs_dir, NULL, &memtype_fops);
 	return 0;
 }
 
Signature · 1 line
1.6.5.2
#1 lore raw

[tip:x86/mm] x86/pat: Trivial: don't create debugfs for memtype if pat is disabled

Commit-ID:  dd4377b02d9f028006beed1b7b1695ee5d1498b6
Gitweb:     http://git.kernel.org/tip/dd4377b02d9f028006beed1b7b1695ee5d1498b6
Author:     Xiaotian Feng <[email protected]>
AuthorDate: Thu, 26 Nov 2009 19:53:48 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 26 Nov 2009 15:05:03 +0100

x86/pat: Trivial: don't create debugfs for memtype if pat is disabled

If pat is disabled (boot with nopat), there's no need to create debugfs for it, it's empty all the time.

Cc Suresh Siddha <[email protected]>
Cc Venkatesh Pallipadi <[email protected]>
Cc H. Peter Anvin <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/x86/mm/pat.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/mm/pat.c +4 -2
index ef71251..a81b7e7 100644
@@ -1019,8 +1019,10 @@ static const struct file_operations memtype_fops = {
 
 static int __init pat_memtype_list_init(void)
 {
-	debugfs_create_file("pat_memtype_list", S_IRUSR, arch_debugfs_dir,
-				NULL, &memtype_fops);
+	if (pat_enabled) {
+		debugfs_create_file("pat_memtype_list", S_IRUSR,
+				    arch_debugfs_dir, NULL, &memtype_fops);
+	}
 	return 0;
 }