Commit c936a79f authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

rhashtable: Simplify iterator code

Remove useless obj variable and goto logic.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a376de8
...@@ -579,7 +579,6 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter) ...@@ -579,7 +579,6 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
struct bucket_table *tbl = iter->walker->tbl; struct bucket_table *tbl = iter->walker->tbl;
struct rhashtable *ht = iter->ht; struct rhashtable *ht = iter->ht;
struct rhash_head *p = iter->p; struct rhash_head *p = iter->p;
void *obj = NULL;
if (p) { if (p) {
p = rht_dereference_bucket_rcu(p->next, tbl, iter->slot); p = rht_dereference_bucket_rcu(p->next, tbl, iter->slot);
...@@ -599,8 +598,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter) ...@@ -599,8 +598,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
if (!rht_is_a_nulls(p)) { if (!rht_is_a_nulls(p)) {
iter->skip++; iter->skip++;
iter->p = p; iter->p = p;
obj = rht_obj(ht, p); return rht_obj(ht, p);
goto out;
} }
iter->skip = 0; iter->skip = 0;
...@@ -618,9 +616,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter) ...@@ -618,9 +616,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
iter->p = NULL; iter->p = NULL;
out: return NULL;
return obj;
} }
EXPORT_SYMBOL_GPL(rhashtable_walk_next); EXPORT_SYMBOL_GPL(rhashtable_walk_next);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment