]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
iface: remove redundant parentheses
authorJan Engelhardt <jengelh@medozas.de>
Sun, 26 Apr 2009 19:56:25 +0000 (21:56 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 26 Apr 2009 19:56:25 +0000 (21:56 +0200)
extensions/libxt_iface.c
extensions/xt_iface.c

index 2bf45339d9b9034d8592f6947ec5e61c6b789e41..903327903032e75a547c0ca3d39cebfc26cda92f 100644 (file)
@@ -62,7 +62,7 @@ static bool iface_valid_name(const char *name)
 {
        char invalid_chars[] = ".+!*";
 
-       return !((strlen(name) >= IFNAMSIZ) || (strcspn(name, invalid_chars) != strlen(name)));
+       return !(strlen(name) >= IFNAMSIZ || strcspn(name, invalid_chars) != strlen(name));
 }
 
 static void iface_mt_help(void)
@@ -158,7 +158,7 @@ static void iface_mt_check(unsigned int flags)
        if (!(flags & XT_IFACE_IFACE))
                xtables_error(PARAMETER_PROBLEM,
                        "iface: You must specify an interface");
-       if ((flags == 0) || (flags == XT_IFACE_IFACE))
+       if (flags == 0 || flags == XT_IFACE_IFACE)
                xtables_error(PARAMETER_PROBLEM,
                        "iface: You must specify at least one option");
 }
index 6d4b2fcda380d52e046d03cec9636568652f31f4..e0da78eccd23c124ec1e30b5c2e01cbd77b97cc0 100644 (file)
@@ -43,15 +43,14 @@ static bool xt_iface_mt(const struct sk_buff *skb,
        int i;
 
        retval =
-           ((dev = dev_get_by_name(&init_net, info->ifname)) != NULL);
+           (dev = dev_get_by_name(&init_net, info->ifname)) != NULL;
        if (retval) {
-               for (i=0; (i<XT_IFACE_FLAGCOUNT) && (retval); i++)
-                       {
+               for (i = 0; i < XT_IFACE_FLAGCOUNT && retval; ++i) {
                        if (info->flags & xt_iface_lookup[i].iface_flag)
                                retval = retval && (dev->flags & xt_iface_lookup[i].iff_flag);
                        if (info->invflags & xt_iface_lookup[i].iface_flag)
                                retval = retval && !(dev->flags & xt_iface_lookup[i].iff_flag);
-                       }
+               }
                dev_put(dev);
        }
        return retval;