Commit 187388bc authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nft_set_hash: unnecessary forward declaration

Replace struct rhashtable_params forward declaration by the structure
definition itself.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 8f23f35f
...@@ -40,8 +40,6 @@ struct nft_hash_cmp_arg { ...@@ -40,8 +40,6 @@ struct nft_hash_cmp_arg {
u8 genmask; u8 genmask;
}; };
static const struct rhashtable_params nft_hash_params;
static inline u32 nft_hash_key(const void *data, u32 len, u32 seed) static inline u32 nft_hash_key(const void *data, u32 len, u32 seed)
{ {
const struct nft_hash_cmp_arg *arg = data; const struct nft_hash_cmp_arg *arg = data;
...@@ -71,6 +69,14 @@ static inline int nft_hash_cmp(struct rhashtable_compare_arg *arg, ...@@ -71,6 +69,14 @@ static inline int nft_hash_cmp(struct rhashtable_compare_arg *arg,
return 0; return 0;
} }
static const struct rhashtable_params nft_hash_params = {
.head_offset = offsetof(struct nft_hash_elem, node),
.hashfn = nft_hash_key,
.obj_hashfn = nft_hash_obj,
.obj_cmpfn = nft_hash_cmp,
.automatic_shrinking = true,
};
static bool nft_hash_lookup(const struct net *net, const struct nft_set *set, static bool nft_hash_lookup(const struct net *net, const struct nft_set *set,
const u32 *key, const struct nft_set_ext **ext) const u32 *key, const struct nft_set_ext **ext)
{ {
...@@ -320,14 +326,6 @@ static unsigned int nft_hash_privsize(const struct nlattr * const nla[]) ...@@ -320,14 +326,6 @@ static unsigned int nft_hash_privsize(const struct nlattr * const nla[])
return sizeof(struct nft_hash); return sizeof(struct nft_hash);
} }
static const struct rhashtable_params nft_hash_params = {
.head_offset = offsetof(struct nft_hash_elem, node),
.hashfn = nft_hash_key,
.obj_hashfn = nft_hash_obj,
.obj_cmpfn = nft_hash_cmp,
.automatic_shrinking = true,
};
static int nft_hash_init(const struct nft_set *set, static int nft_hash_init(const struct nft_set *set,
const struct nft_set_desc *desc, const struct nft_set_desc *desc,
const struct nlattr * const tb[]) const struct nlattr * const tb[])
......
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