netfilter: ipset: Fix coding styles reported by checkpatch.pl
[firefly-linux-kernel-4.4.55.git] / net / netfilter / ipset / ip_set_hash_netport.c
index 27307d0a8a5d97a11650b743943fe3a6c01e69c6..731813e0f08ce6af692386eb0d1cf8cead14454c 100644 (file)
@@ -198,8 +198,9 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[],
 
                if (e.proto == 0)
                        return -IPSET_ERR_INVALID_PROTO;
-       } else
+       } else {
                return -IPSET_ERR_MISSING_PROTO;
+       }
 
        if (!(with_ports || e.proto == IPPROTO_ICMP))
                e.port = 0;
@@ -208,6 +209,7 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[],
 
        if (tb[IPSET_ATTR_CADT_FLAGS]) {
                u32 cadt_flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]);
+
                if (cadt_flags & IPSET_FLAG_NOMATCH)
                        flags |= (IPSET_FLAG_NOMATCH << 16);
        }
@@ -233,8 +235,9 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[],
                        swap(ip, ip_to);
                if (ip + UINT_MAX == ip_to)
                        return -IPSET_ERR_HASH_RANGE;
-       } else
+       } else {
                ip_set_mask_from_to(ip, ip_to, e.cidr + 1);
+       }
 
        if (retried)
                ip = ntohl(h->next.ip);
@@ -250,8 +253,8 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[],
 
                        if (ret && !ip_set_eexist(ret, flags))
                                return ret;
-                       else
-                               ret = 0;
+
+                       ret = 0;
                }
                ip = last + 1;
        }
@@ -413,14 +416,16 @@ hash_netport6_uadt(struct ip_set *set, struct nlattr *tb[],
 
                if (e.proto == 0)
                        return -IPSET_ERR_INVALID_PROTO;
-       } else
+       } else {
                return -IPSET_ERR_MISSING_PROTO;
+       }
 
        if (!(with_ports || e.proto == IPPROTO_ICMPV6))
                e.port = 0;
 
        if (tb[IPSET_ATTR_CADT_FLAGS]) {
                u32 cadt_flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]);
+
                if (cadt_flags & IPSET_FLAG_NOMATCH)
                        flags |= (IPSET_FLAG_NOMATCH << 16);
        }
@@ -444,8 +449,8 @@ hash_netport6_uadt(struct ip_set *set, struct nlattr *tb[],
 
                if (ret && !ip_set_eexist(ret, flags))
                        return ret;
-               else
-                       ret = 0;
+
+               ret = 0;
        }
        return ret;
 }