Skip to content

Commit

Permalink
rhashtable: Remove key length argument to key_hashfn
Browse files Browse the repository at this point in the history
key_hashfn has only one caller and it doesn't really need to supply
the key length as an extra parameter.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Mar 12, 2015
1 parent eca8493 commit cffaa9c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ static u32 obj_raw_hashfn(struct rhashtable *ht,
}

static u32 key_hashfn(struct rhashtable *ht, const struct bucket_table *tbl,
const void *key, u32 len)
const void *key)
{
return rht_bucket_index(tbl, ht->p.hashfn(key, len, tbl->hash_rnd) >>
return rht_bucket_index(tbl, ht->p.hashfn(key, ht->p.key_len,
tbl->hash_rnd) >>
HASH_RESERVED_SPACE);
}

Expand Down Expand Up @@ -619,7 +620,7 @@ void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key,
rcu_read_lock();

tbl = rht_dereference_rcu(ht->tbl, ht);
hash = key_hashfn(ht, tbl, key, ht->p.key_len);
hash = key_hashfn(ht, tbl, key);
restart:
rht_for_each_rcu(he, tbl, hash) {
if (!compare(rht_obj(ht, he), arg))
Expand Down

0 comments on commit cffaa9c

Please sign in to comment.