Remove one leve of intendation by using continue while
iterating over elements in bucket.

Ported from a patch proposed by Sergey Popovich <popovich_ser...@mail.ua>.

Signed-off-by: Jozsef Kadlecsik <kad...@blackhole.kfki.hu>
---
 net/netfilter/ipset/ip_set_hash_gen.h | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/net/netfilter/ipset/ip_set_hash_gen.h 
b/net/netfilter/ipset/ip_set_hash_gen.h
index c4877b6..7999e4c 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -487,21 +487,20 @@ struct htype {
                                continue;
                        }
                        data = ahash_data(n, j, dsize);
-                       if (ip_set_timeout_expired(ext_timeout(data, set))) {
-                               pr_debug("expired %u/%u\n", i, j);
-                               clear_bit(j, n->used);
-                               smp_mb__after_atomic();
+                       if (!ip_set_timeout_expired(ext_timeout(data, set)))
+                               continue;
+                       pr_debug("expired %u/%u\n", i, j);
+                       clear_bit(j, n->used);
+                       smp_mb__after_atomic();
 #ifdef IP_SET_HASH_WITH_NETS
-                               for (k = 0; k < IPSET_NET_COUNT; k++)
-                                       mtype_del_cidr(h,
-                                               NCIDR_PUT(DCIDR_GET(data->cidr,
-                                                                   k)),
-                                               nets_length, k);
+                       for (k = 0; k < IPSET_NET_COUNT; k++)
+                               mtype_del_cidr(h,
+                                       NCIDR_PUT(DCIDR_GET(data->cidr, k)),
+                                       nets_length, k);
 #endif
-                               ip_set_ext_destroy(set, data);
-                               set->elements--;
-                               d++;
-                       }
+                       ip_set_ext_destroy(set, data);
+                       set->elements--;
+                       d++;
                }
                if (d >= AHASH_INIT_SIZE) {
                        if (d >= n->size) {
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to