mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
rhashtable: Use rht_obj() instead of manual offset calculation
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8d24c0b431
commit
a4b18cda4c
@ -427,7 +427,7 @@ void *rhashtable_lookup(const struct rhashtable *ht, const void *key)
|
||||
if (memcmp(rht_obj(ht, he) + ht->p.key_offset, key,
|
||||
ht->p.key_len))
|
||||
continue;
|
||||
return (void *) he - ht->p.head_offset;
|
||||
return rht_obj(ht, he);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -460,7 +460,7 @@ void *rhashtable_lookup_compare(const struct rhashtable *ht, const void *key,
|
||||
rht_for_each_rcu(he, tbl->buckets[hash], ht) {
|
||||
if (!compare(rht_obj(ht, he), arg))
|
||||
continue;
|
||||
return (void *) he - ht->p.head_offset;
|
||||
return rht_obj(ht, he);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user