diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2016-11-10 14:12:25 +0300 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2016-11-10 15:28:46 +0300 |
commit | 5fdb5f6938cf241d574f0ff5504d753c801dc4ae (patch) | |
tree | 5148404a8ca3a2a213db09e23279e13ab15e2622 /net/netfilter/ipset | |
parent | 9e41f26a505cca04b7122e65053cf6447007ea79 (diff) | |
download | linux-5fdb5f6938cf241d574f0ff5504d753c801dc4ae.tar.xz |
netfilter: ipset: Remove redundant mtype_expire() arguments
Remove redundant parameters nets_length and dsize, because
they can be get from other parameters.
Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'net/netfilter/ipset')
-rw-r--r-- | net/netfilter/ipset/ip_set_hash_gen.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 0746405a1d14..c4877b6de74f 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -465,14 +465,15 @@ mtype_same_set(const struct ip_set *a, const struct ip_set *b) /* Delete expired elements from the hashtable */ static void -mtype_expire(struct ip_set *set, struct htype *h, u8 nets_length, size_t dsize) +mtype_expire(struct ip_set *set, struct htype *h) { struct htable *t; struct hbucket *n, *tmp; struct mtype_elem *data; u32 i, j, d; + size_t dsize = set->dsize; #ifdef IP_SET_HASH_WITH_NETS - u8 k; + u8 k, nets_length = NLEN(set->family); #endif t = ipset_dereference_protected(h->table, set); @@ -539,7 +540,7 @@ mtype_gc(unsigned long ul_set) pr_debug("called\n"); spin_lock_bh(&set->lock); - mtype_expire(set, h, NLEN(set->family), set->dsize); + mtype_expire(set, h); spin_unlock_bh(&set->lock); h->gc.expires = jiffies + IPSET_GC_PERIOD(set->timeout) * HZ; @@ -715,7 +716,7 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext, if (set->elements >= h->maxelem) { if (SET_WITH_TIMEOUT(set)) /* FIXME: when set is full, we slow down here */ - mtype_expire(set, h, NLEN(set->family), set->dsize); + mtype_expire(set, h); if (set->elements >= h->maxelem && SET_WITH_FORCEADD(set)) forceadd = true; } |