From: Xiaotian Feng Date: Thu, 26 Nov 2009 11:53:48 +0000 (+0800) Subject: x86/pat: Trivial: don't create debugfs for memtype if pat is disabled X-Git-Tag: v2.6.33-rc1~374^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dd4377b02d9f028006beed1b7b1695ee5d1498b6;p=karo-tx-linux.git 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. Signed-off-by: Xiaotian Feng Cc: Suresh Siddha Cc: Venkatesh Pallipadi Cc: H. Peter Anvin LKML-Reference: <1259236428-16329-1-git-send-email-dfeng@redhat.com> Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index ef712518b5b4..a81b7e73275d 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -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; }