Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4b18cda authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller
Browse files

rhashtable: Use rht_obj() instead of manual offset calculation



Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d24c0b4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;