linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: ptrace.c only needs export.h and not the full module.h
@ 2012-12-06 11:33 Paul Gortmaker
  2012-12-06 16:17 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2012-12-06 11:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, H. Peter Anvin

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.

Cc: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 974b67e..be9b4d4 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -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>
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: ptrace.c only needs export.h and not the full module.h
  2012-12-06 11:33 [PATCH] x86: ptrace.c only needs export.h and not the full module.h Paul Gortmaker
@ 2012-12-06 16:17 ` Borislav Petkov
  2012-12-06 16:34   ` Paul Gortmaker
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2012-12-06 16:17 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, H. Peter Anvin

On Thu, Dec 06, 2012 at 06:33:42AM -0500, Paul Gortmaker wrote:
> 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.

-- 
Regards/Gruss,
    Boris.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: ptrace.c only needs export.h and not the full module.h
  2012-12-06 16:17 ` Borislav Petkov
@ 2012-12-06 16:34   ` Paul Gortmaker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2012-12-06 16:34 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, H. Peter Anvin, rob

[Re: [PATCH] x86: ptrace.c only needs export.h and not the full module.h] On 06/12/2012 (Thu 17:17) Borislav Petkov wrote:

> On Thu, Dec 06, 2012 at 06:33:42AM -0500, Paul Gortmaker wrote:
> > 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.


>From 6d7ea827572bf4a5b7c0bd6ae3f12f5be0a7c7c2 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
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.

Suggested-by: Borislav Petkov <bp@alien8.de>
Cc: Rob Landley <rob@landley.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 Documentation/DocBook/kernel-hacking.tmpl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index eee7142..a23bc37 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -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
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] x86: ptrace.c only needs export.h and not the full module.h
@ 2013-02-14 20:14 Paul Gortmaker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2013-02-14 20:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, Paul Gortmaker, H. Peter Anvin, Jiri Kosina

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.

Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Jiri Kosina <trivial@kernel.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[I didn't see this in tip/auto-latest so vectoring it via trivial]

 arch/x86/kernel/ptrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index b629bbe..29a8120 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -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 <linux/context_tracking.h>
 
 #include <asm/uaccess.h>
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-14 20:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-06 11:33 [PATCH] x86: ptrace.c only needs export.h and not the full module.h Paul Gortmaker
2012-12-06 16:17 ` Borislav Petkov
2012-12-06 16:34   ` Paul Gortmaker
2013-02-14 20:14 Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).