Skip to contentSkip to conversation

x86: compile pat debugfs interface only if CONFIG_X86_PAT is set

PATCH New Andreas Herrmann 2 participants 3 messages Aug 6, 2008 – Aug 11, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
---
 arch/x86/mm/pat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Recently I've run a kernel w/o PAT support and wondered why there was a file "x86/pat_memtype_list" in debugfs. Of course it's empty if PAT is disabled ... so just get rid of this interface if PAT is disabled.

Please apply. (patch against v2.6.27-rc2)

Andreas

arch/x86/mm/pat.c +2 -2
index 2fe3091..647b1c4 100644
@@ -492,7 +492,7 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot)
 	free_memtype(addr, addr + size);
 }
 
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
 
 /* get Nth element of the linked list */
 static struct memtype *memtype_get_idx(loff_t pos)
@@ -576,4 +576,4 @@ static int __init pat_memtype_list_init(void)
 
 late_initcall(pat_memtype_list_init);
 
-#endif /* CONFIG_DEBUG_FS */
+#endif /* CONFIG_DEBUG_FS && CONFIG_X86_PAT */
Signature · 1 line
1.5.6.4
#1 lore raw

PATCH 1/1 x86: compile pat debugfs interface only if CONFIG_X86_PAT is set

---
 arch/x86/mm/pat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Re-submission of the patch -- this time with a proper subject line ...

Regards,
Andreas

arch/x86/mm/pat.c +2 -2
index 2fe3091..647b1c4 100644
@@ -492,7 +492,7 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot)
 	free_memtype(addr, addr + size);
 }
 
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
 
 /* get Nth element of the linked list */
 static struct memtype *memtype_get_idx(loff_t pos)
@@ -576,4 +576,4 @@ static int __init pat_memtype_list_init(void)
 
 late_initcall(pat_memtype_list_init);
 
-#endif /* CONFIG_DEBUG_FS */
+#endif /* CONFIG_DEBUG_FS && CONFIG_X86_PAT */
Signature · 1 line
1.5.6.4
Applied
#2 lore raw
In reply to Andreas Herrmann
Quoted 9 lines · Andreas Herrmann
---
 arch/x86/mm/pat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Recently I've run a kernel w/o PAT support and wondered why there was a file "x86/pat_memtype_list" in debugfs. Of course it's empty if PAT is disabled ... so just get rid of this interface if PAT is disabled.

applied to tip/x86/pat - thanks Andreas.

Ingo