diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-10-29 12:23:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-01 12:41:35 -0400 |
commit | 07a936260a94ae4798527ce8f79d4f3b589ab8a3 (patch) | |
tree | bf8ff84c3045cd3b8b2b2970a6c7491439172939 /net/ipv6/addrconf.c | |
parent | cc535dfb6a85b42218307c43f60668d7bd6f4318 (diff) |
ipv6: use IS_ENABLED()
#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
can be replaced by
#if IS_ENABLED(CONFIG_FOO)
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8f0b12a67131..387b813f227d 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -402,7 +402,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev) | |||
402 | if (dev->flags & (IFF_NOARP | IFF_LOOPBACK)) | 402 | if (dev->flags & (IFF_NOARP | IFF_LOOPBACK)) |
403 | ndev->cnf.accept_dad = -1; | 403 | ndev->cnf.accept_dad = -1; |
404 | 404 | ||
405 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 405 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
406 | if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) { | 406 | if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) { |
407 | pr_info("%s: Disabled Multicast RS\n", dev->name); | 407 | pr_info("%s: Disabled Multicast RS\n", dev->name); |
408 | ndev->cnf.rtr_solicits = 0; | 408 | ndev->cnf.rtr_solicits = 0; |
@@ -1838,7 +1838,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev, | |||
1838 | This thing is done here expecting that the whole | 1838 | This thing is done here expecting that the whole |
1839 | class of non-broadcast devices need not cloning. | 1839 | class of non-broadcast devices need not cloning. |
1840 | */ | 1840 | */ |
1841 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 1841 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
1842 | if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT)) | 1842 | if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT)) |
1843 | cfg.fc_flags |= RTF_NONEXTHOP; | 1843 | cfg.fc_flags |= RTF_NONEXTHOP; |
1844 | #endif | 1844 | #endif |
@@ -1898,7 +1898,7 @@ static void addrconf_add_mroute(struct net_device *dev) | |||
1898 | ip6_route_add(&cfg); | 1898 | ip6_route_add(&cfg); |
1899 | } | 1899 | } |
1900 | 1900 | ||
1901 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 1901 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
1902 | static void sit_route_add(struct net_device *dev) | 1902 | static void sit_route_add(struct net_device *dev) |
1903 | { | 1903 | { |
1904 | struct fib6_config cfg = { | 1904 | struct fib6_config cfg = { |
@@ -2250,7 +2250,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) | |||
2250 | if (dev == NULL) | 2250 | if (dev == NULL) |
2251 | goto err_exit; | 2251 | goto err_exit; |
2252 | 2252 | ||
2253 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 2253 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
2254 | if (dev->type == ARPHRD_SIT) { | 2254 | if (dev->type == ARPHRD_SIT) { |
2255 | const struct net_device_ops *ops = dev->netdev_ops; | 2255 | const struct net_device_ops *ops = dev->netdev_ops; |
2256 | struct ifreq ifr; | 2256 | struct ifreq ifr; |
@@ -2461,7 +2461,7 @@ static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr, | |||
2461 | } | 2461 | } |
2462 | } | 2462 | } |
2463 | 2463 | ||
2464 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 2464 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
2465 | static void sit_add_v4_addrs(struct inet6_dev *idev) | 2465 | static void sit_add_v4_addrs(struct inet6_dev *idev) |
2466 | { | 2466 | { |
2467 | struct in6_addr addr; | 2467 | struct in6_addr addr; |
@@ -2580,7 +2580,7 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2580 | addrconf_add_linklocal(idev, &addr); | 2580 | addrconf_add_linklocal(idev, &addr); |
2581 | } | 2581 | } |
2582 | 2582 | ||
2583 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 2583 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
2584 | static void addrconf_sit_config(struct net_device *dev) | 2584 | static void addrconf_sit_config(struct net_device *dev) |
2585 | { | 2585 | { |
2586 | struct inet6_dev *idev; | 2586 | struct inet6_dev *idev; |
@@ -2617,7 +2617,7 @@ static void addrconf_sit_config(struct net_device *dev) | |||
2617 | } | 2617 | } |
2618 | #endif | 2618 | #endif |
2619 | 2619 | ||
2620 | #if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE) | 2620 | #if IS_ENABLED(CONFIG_NET_IPGRE) |
2621 | static void addrconf_gre_config(struct net_device *dev) | 2621 | static void addrconf_gre_config(struct net_device *dev) |
2622 | { | 2622 | { |
2623 | struct inet6_dev *idev; | 2623 | struct inet6_dev *idev; |
@@ -2747,12 +2747,12 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, | |||
2747 | } | 2747 | } |
2748 | 2748 | ||
2749 | switch (dev->type) { | 2749 | switch (dev->type) { |
2750 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 2750 | #if IS_ENABLED(CONFIG_IPV6_SIT) |
2751 | case ARPHRD_SIT: | 2751 | case ARPHRD_SIT: |
2752 | addrconf_sit_config(dev); | 2752 | addrconf_sit_config(dev); |
2753 | break; | 2753 | break; |
2754 | #endif | 2754 | #endif |
2755 | #if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE) | 2755 | #if IS_ENABLED(CONFIG_NET_IPGRE) |
2756 | case ARPHRD_IPGRE: | 2756 | case ARPHRD_IPGRE: |
2757 | addrconf_gre_config(dev); | 2757 | addrconf_gre_config(dev); |
2758 | break; | 2758 | break; |
@@ -3340,7 +3340,7 @@ void if6_proc_exit(void) | |||
3340 | } | 3340 | } |
3341 | #endif /* CONFIG_PROC_FS */ | 3341 | #endif /* CONFIG_PROC_FS */ |
3342 | 3342 | ||
3343 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 3343 | #if IS_ENABLED(CONFIG_IPV6_MIP6) |
3344 | /* Check if address is a home address configured on any interface. */ | 3344 | /* Check if address is a home address configured on any interface. */ |
3345 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr) | 3345 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr) |
3346 | { | 3346 | { |