Skip to content

Commit

Permalink
rhashtable: Simplify iterator code
Browse files Browse the repository at this point in the history
Remove useless obj variable and goto logic.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed May 5, 2015
1 parent 1a376de commit c936a79
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
struct bucket_table *tbl = iter->walker->tbl;
struct rhashtable *ht = iter->ht;
struct rhash_head *p = iter->p;
void *obj = NULL;

if (p) {
p = rht_dereference_bucket_rcu(p->next, tbl, iter->slot);
Expand All @@ -599,8 +598,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
if (!rht_is_a_nulls(p)) {
iter->skip++;
iter->p = p;
obj = rht_obj(ht, p);
goto out;
return rht_obj(ht, p);
}

iter->skip = 0;
Expand All @@ -618,9 +616,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)

iter->p = NULL;

out:

return obj;
return NULL;
}
EXPORT_SYMBOL_GPL(rhashtable_walk_next);

Expand Down

0 comments on commit c936a79

Please sign in to comment.