]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: nf_conntrack: sparse warnings
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 31 Jan 2008 12:07:29 +0000 (04:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2008 03:27:44 +0000 (19:27 -0800)
The hashtable size is really unsigned so sparse complains when you pass
a signed integer.  Change all uses to make it consistent.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netfilter/nf_conntrack.h
net/netfilter/nf_conntrack_core.c

index 857d89951790ab2b35c37c38b9628689e1296536..dada0411abd1a6d0de9a7084b21ae06309c1d020 100644 (file)
@@ -171,9 +171,9 @@ static inline void nf_ct_put(struct nf_conn *ct)
 extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);
 extern void nf_ct_l3proto_module_put(unsigned short l3proto);
 
-extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced);
+extern struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced);
 extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
-                                int size);
+                                unsigned int size);
 
 extern struct nf_conntrack_tuple_hash *
 __nf_conntrack_find(const struct nf_conntrack_tuple *tuple,
index 078fff0335ad2170ca06a60ad781fcfa0d08018e..7b1f7e80f2f877a485c0ebd40a96af0f97571f5d 100644 (file)
@@ -939,7 +939,7 @@ static int kill_all(struct nf_conn *i, void *data)
        return 1;
 }
 
-void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, int size)
+void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, unsigned int size)
 {
        if (vmalloced)
                vfree(hash);
@@ -988,7 +988,7 @@ void nf_conntrack_cleanup(void)
        nf_conntrack_expect_fini();
 }
 
-struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced)
+struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced)
 {
        struct hlist_head *hash;
        unsigned int size, i;
@@ -1015,8 +1015,8 @@ EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable);
 
 int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
 {
-       int i, bucket, hashsize, vmalloced;
-       int old_vmalloced, old_size;
+       int i, bucket, vmalloced, old_vmalloced;
+       unsigned int hashsize, old_size;
        int rnd;
        struct hlist_head *hash, *old_hash;
        struct nf_conntrack_tuple_hash *h;
@@ -1025,7 +1025,7 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
        if (!nf_conntrack_htable_size)
                return param_set_uint(val, kp);
 
-       hashsize = simple_strtol(val, NULL, 0);
+       hashsize = simple_strtoul(val, NULL, 0);
        if (!hashsize)
                return -EINVAL;