* [PATCH] rhashtable: use rht_obj() consistently
@ 2015-02-13 20:42 Johannes Berg
2015-02-13 20:58 ` Thomas Graf
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2015-02-13 20:42 UTC (permalink / raw)
To: netdev; +Cc: Thomas Graf, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Looking at the RHT code I found two places where this was
done manually rather than using the rht_obj() helper, use
that instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
lib/rhashtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 6c3c723e902b..a8ea16093839 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -457,7 +457,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;
@@ -491,7 +491,7 @@ void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash,
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;
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] rhashtable: use rht_obj() consistently
2015-02-13 20:42 [PATCH] rhashtable: use rht_obj() consistently Johannes Berg
@ 2015-02-13 20:58 ` Thomas Graf
2015-02-13 21:42 ` Thomas Graf
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2015-02-13 20:58 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, Johannes Berg
On 02/13/15 at 09:42pm, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Looking at the RHT code I found two places where this was
> done manually rather than using the rht_obj() helper, use
> that instead.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rhashtable: use rht_obj() consistently
2015-02-13 20:58 ` Thomas Graf
@ 2015-02-13 21:42 ` Thomas Graf
2015-02-15 4:31 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2015-02-13 21:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, Johannes Berg
On 02/13/15 at 08:58pm, Thomas Graf wrote:
> On 02/13/15 at 09:42pm, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > Looking at the RHT code I found two places where this was
> > done manually rather than using the rht_obj() helper, use
> > that instead.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>
> Acked-by: Thomas Graf <tgraf@suug.ch>
Actually, this is already "fixed" in net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rhashtable: use rht_obj() consistently
2015-02-13 21:42 ` Thomas Graf
@ 2015-02-15 4:31 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-02-15 4:31 UTC (permalink / raw)
To: tgraf; +Cc: johannes, netdev, johannes.berg
From: Thomas Graf <tgraf@suug.ch>
Date: Fri, 13 Feb 2015 21:42:08 +0000
> On 02/13/15 at 08:58pm, Thomas Graf wrote:
>> On 02/13/15 at 09:42pm, Johannes Berg wrote:
>> > From: Johannes Berg <johannes.berg@intel.com>
>> >
>> > Looking at the RHT code I found two places where this was
>> > done manually rather than using the rht_obj() helper, use
>> > that instead.
>> >
>> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>
>> Acked-by: Thomas Graf <tgraf@suug.ch>
>
> Actually, this is already "fixed" in net-next.
So I'm going to toss this.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-15 4:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 20:42 [PATCH] rhashtable: use rht_obj() consistently Johannes Berg
2015-02-13 20:58 ` Thomas Graf
2015-02-13 21:42 ` Thomas Graf
2015-02-15 4:31 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox