Skip to contentSkip to conversation

move include lines out of include file

PATCH In review Jim Rees 3 participants 4 messages Oct 22, 2010 – Oct 25, 2010

Subsystems (3)
lore
Share & tools
lore

Jim Rees

author
#0 lore raw

PATCH 1/1 move include lines out of include file

---
 include/linux/sunrpc/simple_rpc_pipefs.h |    6 ------
 net/sunrpc/simple_rpc_pipefs.c           |    5 +++++
 2 files changed, 5 insertions(+), 6 deletions(-)
include/linux/sunrpc/simple_rpc_pipefs.h +0 -6
index 02e8147..f6a1227 100644
@@ -39,14 +39,8 @@
 #ifndef _SIMPLE_RPC_PIPEFS_H_
 #define _SIMPLE_RPC_PIPEFS_H_
 
-#include <linux/fs.h>
-#include <linux/list.h>
-#include <linux/mount.h>
-#include <linux/sched.h>
-#include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
-
 #define payload_of(headerp)  ((void *)(headerp + 1))
 
 /*
net/sunrpc/simple_rpc_pipefs.c +5 -0
index c9306aa..b749cf7 100644
@@ -41,6 +41,11 @@
 #include <linux/completion.h>
 #include <linux/uaccess.h>
 #include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/list.h>
+#include <linux/mount.h>
+#include <linux/sched.h>
+#include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/simple_rpc_pipefs.h>
 
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 30 lines · Jim Rees
---
 include/linux/sunrpc/simple_rpc_pipefs.h |    6 ------
 net/sunrpc/simple_rpc_pipefs.c           |    5 +++++
 2 files changed, 5 insertions(+), 6 deletions(-)
include/linux/sunrpc/simple_rpc_pipefs.h +0 -6
index 02e8147..f6a1227 100644
@@ -39,14 +39,8 @@
 #ifndef _SIMPLE_RPC_PIPEFS_H_
 #define _SIMPLE_RPC_PIPEFS_H_
 
-#include <linux/fs.h>
-#include <linux/list.h>
-#include <linux/mount.h>
-#include <linux/sched.h>
-#include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 
-
 #define payload_of(headerp)  ((void *)(headerp + 1))
 
 /*
net/sunrpc/simple_rpc_pipefs.c +0 -0
index c9306aa..b749cf7 100644

net/sunrpc/simple_rpc_pipefs.c line 50

Quoted 10 lines
net/sunrpc/simple_rpc_pipefs.c +5 -0
@@ -41,6 +41,11 @@
 #include <linux/completion.h>
 #include <linux/uaccess.h>
 #include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/list.h>
+#include <linux/mount.h>
+#include <linux/sched.h>
+#include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/simple_rpc_pipefs.h>
 

This patch does *not* break the header's independence. .i.e the header can still be compiled independently without any other includes. Which means some of the includes here are un-needed. See patch below. (Please squash it into your patch)

Boaz
---
git diff --stat -p -M net/sunrpc/simple_rpc_pipefs.c

 net/sunrpc/simple_rpc_pipefs.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
net/sunrpc/simple_rpc_pipefs.c +0 -6
index c4825b7..24e2277 100644
@@ -38,13 +38,7 @@
  *  With thanks to CITI's project sponsor and partner, IBM.
  */
 
-#include <linux/completion.h>
-#include <linux/uaccess.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/list.h>
 #include <linux/mount.h>
-#include <linux/sched.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/simple_rpc_pipefs.h>
 
author
#2 lore raw

Boaz Harrosh wrote:

This patch does *not* break the header's independence. .i.e the header can still be compiled independently without any other includes. Which means some of the includes here are un-needed.

Thanks! I tried removing all the includes but was too lazy to figure out which one was really needed by simple_rpc_pipefs.c.

#3 lore raw
Quoted 8 lines · Jim Rees

Boaz Harrosh wrote:

This patch does *not* break the header's independence. .i.e the header can still be compiled independently without any other includes. Which means some of the includes here are un-needed.

Thanks! I tried removing all the includes but was too lazy to figure out which one was really needed by simple_rpc_pipefs.c.

Yup.
The self-sustainability approach is the best one, i.e. header files should include the minimum number of other header files to satisfy their dependencies.

I'll merge both patches squashed together then.

Benny