diff options
author | Thomas Graf <tgraf@suug.ch> | 2015-05-05 02:22:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-05 19:30:47 -0400 |
commit | c936a79fc01ef1115a46f940944ebe7385845673 (patch) | |
tree | f05f998097f18a9a19fbffa8249ebbaf3383df3d /lib/rhashtable.c | |
parent | 1a376de8e3d120df54f6277f82e1ee987e2d7e8f (diff) | |
download | blackbird-op-linux-c936a79fc01ef1115a46f940944ebe7385845673.tar.gz blackbird-op-linux-c936a79fc01ef1115a46f940944ebe7385845673.zip |
rhashtable: Simplify iterator code
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>
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r-- | lib/rhashtable.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index b28df4019ade..4936fc4d7f2c 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -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); @@ -599,8 +598,7 @@ next: 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; @@ -618,9 +616,7 @@ next: iter->p = NULL; -out: - - return obj; + return NULL; } EXPORT_SYMBOL_GPL(rhashtable_walk_next); |