Commit 96eb24d7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NETFILTER]: nf_conntrack: sparse warnings

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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06aa1072
...@@ -171,9 +171,9 @@ static inline void nf_ct_put(struct nf_conn *ct) ...@@ -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 int nf_ct_l3proto_try_module_get(unsigned short l3proto);
extern void nf_ct_l3proto_module_put(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, extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
int size); unsigned int size);
extern struct nf_conntrack_tuple_hash * extern struct nf_conntrack_tuple_hash *
__nf_conntrack_find(const struct nf_conntrack_tuple *tuple, __nf_conntrack_find(const struct nf_conntrack_tuple *tuple,
......
...@@ -939,7 +939,7 @@ static int kill_all(struct nf_conn *i, void *data) ...@@ -939,7 +939,7 @@ static int kill_all(struct nf_conn *i, void *data)
return 1; 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) if (vmalloced)
vfree(hash); vfree(hash);
...@@ -988,7 +988,7 @@ void nf_conntrack_cleanup(void) ...@@ -988,7 +988,7 @@ void nf_conntrack_cleanup(void)
nf_conntrack_expect_fini(); 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; struct hlist_head *hash;
unsigned int size, i; unsigned int size, i;
...@@ -1015,8 +1015,8 @@ EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable); ...@@ -1015,8 +1015,8 @@ EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable);
int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
{ {
int i, bucket, hashsize, vmalloced; int i, bucket, vmalloced, old_vmalloced;
int old_vmalloced, old_size; unsigned int hashsize, old_size;
int rnd; int rnd;
struct hlist_head *hash, *old_hash; struct hlist_head *hash, *old_hash;
struct nf_conntrack_tuple_hash *h; struct nf_conntrack_tuple_hash *h;
...@@ -1025,7 +1025,7 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) ...@@ -1025,7 +1025,7 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
if (!nf_conntrack_htable_size) if (!nf_conntrack_htable_size)
return param_set_uint(val, kp); return param_set_uint(val, kp);
hashsize = simple_strtol(val, NULL, 0); hashsize = simple_strtoul(val, NULL, 0);
if (!hashsize) if (!hashsize)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment