aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2015-01-02 17:00:15 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-03 14:32:56 -0500
commita4b18cda4c2676a4b4b59622b2e0394dc153e00b (patch)
tree9be5c3e8586a2248d8b097d975f5d3e870d5a741 /lib
parent8d24c0b43125ec26cc80e04588477a9a2afc025c (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c4
1 files changed, 2 insertions, 2 deletions
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)
427 if (memcmp(rht_obj(ht, he) + ht->p.key_offset, key, 427 if (memcmp(rht_obj(ht, he) + ht->p.key_offset, key,
428 ht->p.key_len)) 428 ht->p.key_len))
429 continue; 429 continue;
430 return (void *) he - ht->p.head_offset; 430 return rht_obj(ht, he);
431 } 431 }
432 432
433 return NULL; 433 return NULL;
@@ -460,7 +460,7 @@ void *rhashtable_lookup_compare(const struct rhashtable *ht, const void *key,
460 rht_for_each_rcu(he, tbl->buckets[hash], ht) { 460 rht_for_each_rcu(he, tbl->buckets[hash], ht) {
461 if (!compare(rht_obj(ht, he), arg)) 461 if (!compare(rht_obj(ht, he), arg))
462 continue; 462 continue;
463 return (void *) he - ht->p.head_offset; 463 return rht_obj(ht, he);
464 } 464 }
465 465
466 return NULL; 466 return NULL;