Skip to content

Commit

Permalink
x86/pat: Trivial: don't create debugfs for memtype if pat is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiaotian Feng authored and Ingo Molnar committed Nov 26, 2009
1 parent 5bf65b9 commit dd4377b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86/mm/pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dd4377b

Please sign in to comment.