[PATCH 2.4] fix warning and compiletime error in neighbour.c

From: Michael Buesch
Date: Sun Nov 07 2004 - 11:21:46 EST


Hi Marcelo,

This patch fixes the following:
gcc -D__KERNEL__ -I/home/mb/kernel/linux-2.4.28-rc1-bk4/include \
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing \
-fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 \
-march=i586 -nostdinc -iwithprefix include \
-DKBUILD_BASENAME=neighbour -c -o neighbour.o neighbour.c
neighbour.c: In function `neigh_seq_stop':
neighbour.c:1805: warning: unused variable `tbl'
neighbour.c: At top level:
neighbour.c:1901: `THIS_MODULE' undeclared here (not in a function)
neighbour.c:1901: initializer element is not constant
neighbour.c:1901: (near initialization for `neigh_stat_seq_fops.owner')

Sorry for the attachment. My mailer is currently broken and
corrupts diffs.
--- linux-2.4.28-rc1-bk4/net/core/neighbour.c.orig Sun Nov 7 15:09:36 2004
+++ linux-2.4.28-rc1-bk4/net/core/neighbour.c Sun Nov 7 15:16:10 2004
@@ -31,6 +31,7 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/random.h>
+#include <linux/module.h>

#define NEIGH_DEBUG 1

@@ -1801,10 +1802,7 @@

void neigh_seq_stop(struct seq_file *seq, void *v)
{
- struct neigh_seq_state *state = seq->private;
- struct neigh_table *tbl = state->tbl;
-
- read_unlock_bh(&tbl->lock);
+ read_unlock_bh(&seq->private->tbl->lock);
}

/* statistics via seq_file */