Skip to contentSkip to conversation

x86: ptrace.c only needs export.h and not the full module.h

PATCH In review Paul Gortmaker 2 participants 3 messages Dec 6, 2012

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

PATCH 1/1 x86: ptrace.c only needs export.h and not the full module.h

Commit cb57a2b4cff7edf2a4e32c0163200e9434807e0a ("x86-32: Export kernel_stack_pointer() for modules") added an include of the module.h header in conjunction with adding an EXPORT_SYMBOL_GPL of kernel_stack_pointer.

But module.h should be avoided for simple exports, since it in turn includes the world. Swap the module.h for export.h instead.

arch/x86/kernel/ptrace.c +1 -1
index 974b67e..be9b4d4 100644
@@ -22,7 +22,7 @@
 #include <linux/perf_event.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/rcupdate.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
Signature · 1 line
1.8.0
maintainer
#1 lore raw
Quoted 7 lines · Paul Gortmaker

Commit cb57a2b4cff7edf2a4e32c0163200e9434807e0a ("x86-32: Export kernel_stack_pointer() for modules") added an include of the module.h header in conjunction with adding an EXPORT_SYMBOL_GPL of kernel_stack_pointer.

But module.h should be avoided for simple exports, since it in turn includes the world. Swap the module.h for export.h instead.

If this is the preferred include for EXPORT_SYMBOL* stuff now, maybe we should hold this down somewhere in writing or add it to checkpatch?

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
#2 lore raw
Quoted 11 lines · [Re: [PATCH] x86: ptrace.c only needs export.h and not the full module.h] On…
Quoted 7 lines · Paul Gortmaker

Commit cb57a2b4cff7edf2a4e32c0163200e9434807e0a ("x86-32: Export kernel_stack_pointer() for modules") added an include of the module.h header in conjunction with adding an EXPORT_SYMBOL_GPL of kernel_stack_pointer.

But module.h should be avoided for simple exports, since it in turn includes the world. Swap the module.h for export.h instead.

If this is the preferred include for EXPORT_SYMBOL* stuff now, maybe we should hold this down somewhere in writing or add it to checkpatch?

Good point. Fixed below.

Thanks,
Paul.

Quoted 1 line

From 6d7ea827572bf4a5b7c0bd6ae3f12f5be0a7c7c2 Mon Sep 17 00:00:00 2001

From: Paul Gortmaker <[email protected]>
Date: Thu, 6 Dec 2012 11:26:53 -0500
Subject: [PATCH] DocBook: update EXPORT_SYMBOL entry to point at export.h

Previously we used to get EXPORT_SYMBOL and friends from module.h but we moved away from that since module.h largely includes the entire header space one way or another.

As most users just wanted the simple export related macros, they were spun off into a separate new header -- export.h Update the docs to reflect that.

---
 Documentation/DocBook/kernel-hacking.tmpl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/DocBook/kernel-hacking.tmpl +2 -2
index eee7142..a23bc37 100644
@@ -945,7 +945,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
 
   <sect1 id="sym-exportsymbols">
    <title><function>EXPORT_SYMBOL()</function>
-    <filename class="headerfile">include/linux/module.h</filename></title>
+    <filename class="headerfile">include/linux/export.h</filename></title>
 
    <para>
     This is the classic method of exporting a symbol: dynamically
@@ -955,7 +955,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
 
   <sect1 id="sym-exportsymbols-gpl">
    <title><function>EXPORT_SYMBOL_GPL()</function>
-    <filename class="headerfile">include/linux/module.h</filename></title>
+    <filename class="headerfile">include/linux/export.h</filename></title>
 
    <para>
     Similar to <function>EXPORT_SYMBOL()</function> except that the
Signature · 1 line
1.8.0