x86/pat: Trivial: don't create debugfs for memtype if pat is disabled
authorXiaotian Feng <dfeng@redhat.com>
Thu, 26 Nov 2009 11:53:48 +0000 (19:53 +0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Nov 2009 14:05:03 +0000 (15:05 +0100)
If pat is disabled (boot with nopat), there's no need to create
debugfs for it, it's empty all the time.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <1259236428-16329-1-git-send-email-dfeng@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/pat.c

index ef712518b5b449b5f28a7a16d70b78c6ee7e46e5..a81b7e73275d5ac26306e727dd736289236da1e7 100644 (file)
@@ -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;
 }