From: Thomas Graf Date: Fri, 2 Jan 2015 22:00:15 +0000 (+0100) Subject: rhashtable: Use rht_obj() instead of manual offset calculation X-Git-Tag: MMI-PSA29.97-13-9~10678^2~294^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a4b18cda4c2676a4b4b59622b2e0394dc153e00b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git rhashtable: Use rht_obj() instead of manual offset calculation Signed-off-by: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 1ee0eb636ca3..b658245826a1 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -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;