From 18062ca94714a66e75da8a22e010d0e8e61ab4cd Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 24 Mar 2010 01:57:30 +0000 Subject: rds: cleanup: remove unneeded variable We never use "sk" so this patch removes it. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- net/rds/af_rds.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'net/rds') diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 937ecda..c2e45e8 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -451,7 +451,6 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len, struct rds_info_lengths *lens) { struct rds_sock *rs; - struct sock *sk; struct rds_incoming *inc; unsigned long flags; unsigned int total = 0; @@ -461,7 +460,6 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len, spin_lock_irqsave(&rds_sock_lock, flags); list_for_each_entry(rs, &rds_sock_list, rs_item) { - sk = rds_rs_to_sk(rs); read_lock(&rs->rs_recv_lock); /* XXX too lazy to maintain counts.. */ -- cgit v1.1 From 5a0e3ad6af8660be21ca98a971cd00f331318c05 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 24 Mar 2010 17:04:11 +0900 Subject: include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo Guess-its-ok-by: Christoph Lameter Cc: Ingo Molnar Cc: Lee Schermerhorn --- net/rds/af_rds.c | 1 + net/rds/cong.c | 1 + net/rds/connection.c | 1 + net/rds/ib.c | 1 + net/rds/ib_cm.c | 1 + net/rds/ib_rdma.c | 1 + net/rds/ib_recv.c | 1 + net/rds/info.c | 1 + net/rds/iw.c | 1 + net/rds/iw_cm.c | 1 + net/rds/iw_rdma.c | 1 + net/rds/iw_recv.c | 1 + net/rds/loop.c | 1 + net/rds/message.c | 1 + net/rds/page.c | 1 + net/rds/rdma.c | 1 + net/rds/recv.c | 1 + net/rds/send.c | 1 + net/rds/tcp.c | 1 + net/rds/tcp_listen.c | 1 + net/rds/tcp_recv.c | 1 + 21 files changed, 21 insertions(+) (limited to 'net/rds') diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 853c52b..f81862b 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/net/rds/cong.c b/net/rds/cong.c index 6d06cac..f1da27c 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c @@ -30,6 +30,7 @@ * SOFTWARE. * */ +#include #include #include diff --git a/net/rds/connection.c b/net/rds/connection.c index 278f607..7619b67 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -32,6 +32,7 @@ */ #include #include +#include #include #include "rds.h" diff --git a/net/rds/ib.c b/net/rds/ib.c index 3b89923..8f2d6dd 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "rds.h" #include "ib.h" diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 647cb8f..88d0856 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -32,6 +32,7 @@ */ #include #include +#include #include #include "rds.h" diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 4b0da86..059989f 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -31,6 +31,7 @@ * */ #include +#include #include "rds.h" #include "rdma.h" diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 04dc0d3..c7dd11b 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include #include diff --git a/net/rds/info.c b/net/rds/info.c index 814a91a..c45c417 100644 --- a/net/rds/info.c +++ b/net/rds/info.c @@ -32,6 +32,7 @@ */ #include #include +#include #include #include "rds.h" diff --git a/net/rds/iw.c b/net/rds/iw.c index b28fa85..c8f3d35 100644 --- a/net/rds/iw.c +++ b/net/rds/iw.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "rds.h" #include "iw.h" diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c index 394cf6b..3e9460f 100644 --- a/net/rds/iw_cm.c +++ b/net/rds/iw_cm.c @@ -32,6 +32,7 @@ */ #include #include +#include #include #include "rds.h" diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c index 9eda11c..13dc186 100644 --- a/net/rds/iw_rdma.c +++ b/net/rds/iw_rdma.c @@ -31,6 +31,7 @@ * */ #include +#include #include "rds.h" #include "rdma.h" diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c index 54af7d6..da43ee8 100644 --- a/net/rds/iw_recv.c +++ b/net/rds/iw_recv.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include #include diff --git a/net/rds/loop.c b/net/rds/loop.c index 4a61997..0d7a159 100644 --- a/net/rds/loop.c +++ b/net/rds/loop.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include "rds.h" diff --git a/net/rds/message.c b/net/rds/message.c index 73e600f..9a1d67e 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -31,6 +31,7 @@ * */ #include +#include #include "rds.h" #include "rdma.h" diff --git a/net/rds/page.c b/net/rds/page.c index 3679012..595a952 100644 --- a/net/rds/page.c +++ b/net/rds/page.c @@ -31,6 +31,7 @@ * */ #include +#include #include "rds.h" diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 4c64daa..5ce9437 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include /* for DMA_*_DEVICE */ diff --git a/net/rds/recv.c b/net/rds/recv.c index b426d67..e2a2b93 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include diff --git a/net/rds/send.c b/net/rds/send.c index b2fccfc..f04b929 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include #include diff --git a/net/rds/tcp.c b/net/rds/tcp.c index b5198ae..babf457 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 53cb1b5..975183f 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c index c00daff..e08ec91 100644 --- a/net/rds/tcp_recv.c +++ b/net/rds/tcp_recv.c @@ -31,6 +31,7 @@ * */ #include +#include #include #include "rds.h" -- cgit v1.1