]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ipv4/ipmr and ipv6/ip6mr: Convert int mroute_do_<foo> to bool
authorJoe Perches <joe@perches.com>
Sun, 25 Nov 2012 09:35:30 +0000 (09:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 25 Nov 2012 21:34:17 +0000 (16:34 -0500)
Save a few bytes per table by convert mroute_do_assert and
mroute_do_pim from int to bool.

Remove !! as the compiler does that when assigning int to bool.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c
net/ipv6/ip6mr.c

index 0394a8e6d978e55dcf267e804c7d01cd268591d7..fc09ef93663699a7879d66fca9175ecc629d5c68 100644 (file)
@@ -83,8 +83,8 @@ struct mr_table {
        struct vif_device       vif_table[MAXVIFS];
        int                     maxvif;
        atomic_t                cache_resolve_queue_len;
-       int                     mroute_do_assert;
-       int                     mroute_do_pim;
+       bool                    mroute_do_assert;
+       bool                    mroute_do_pim;
 #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2)
        int                     mroute_reg_vif_num;
 #endif
@@ -1289,7 +1289,7 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi
                        return -EINVAL;
                if (get_user(v, (int __user *)optval))
                        return -EFAULT;
-               mrt->mroute_do_assert = !!v;
+               mrt->mroute_do_assert = v;
                return 0;
        }
 #ifdef CONFIG_IP_PIMSM
index d7330f8ea6d449633a4dc6213e9fa3ca0ad84017..79bb49061ef6ddb5398c3213ddb2da14f49b5fc7 100644 (file)
@@ -66,8 +66,8 @@ struct mr6_table {
        struct mif_device       vif6_table[MAXMIFS];
        int                     maxvif;
        atomic_t                cache_resolve_queue_len;
-       int                     mroute_do_assert;
-       int                     mroute_do_pim;
+       bool                    mroute_do_assert;
+       bool                    mroute_do_pim;
 #ifdef CONFIG_IPV6_PIMSM_V2
        int                     mroute_reg_vif_num;
 #endif
@@ -1648,7 +1648,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
                int v;
                if (get_user(v, (int __user *)optval))
                        return -EFAULT;
-               mrt->mroute_do_assert = !!v;
+               mrt->mroute_do_assert = v;
                return 0;
        }