提交 d90f9b35 编写于 作者: R Roland Dreier

IB: Use IS_ENABLED(CONFIG_IPV6)

Instead of testing defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 6887a413
...@@ -129,7 +129,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) ...@@ -129,7 +129,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
dev_put(dev); dev_put(dev);
break; break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
case AF_INET6: case AF_INET6:
rcu_read_lock(); rcu_read_lock();
for_each_netdev_rcu(&init_net, dev) { for_each_netdev_rcu(&init_net, dev) {
...@@ -243,7 +243,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, ...@@ -243,7 +243,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
return ret; return ret;
} }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
static int addr6_resolve(struct sockaddr_in6 *src_in, static int addr6_resolve(struct sockaddr_in6 *src_in,
struct sockaddr_in6 *dst_in, struct sockaddr_in6 *dst_in,
struct rdma_dev_addr *addr) struct rdma_dev_addr *addr)
......
...@@ -2278,7 +2278,7 @@ static int cma_get_port(struct rdma_id_private *id_priv) ...@@ -2278,7 +2278,7 @@ static int cma_get_port(struct rdma_id_private *id_priv)
static int cma_check_linklocal(struct rdma_dev_addr *dev_addr, static int cma_check_linklocal(struct rdma_dev_addr *dev_addr,
struct sockaddr *addr) struct sockaddr *addr)
{ {
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
struct sockaddr_in6 *sin6; struct sockaddr_in6 *sin6;
if (addr->sa_family != AF_INET6) if (addr->sa_family != AF_INET6)
......
...@@ -202,8 +202,7 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) ...@@ -202,8 +202,7 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev)
return 0; return 0;
} }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) || \ #if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_VLAN_8021Q)
defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
static int ocrdma_inet6addr_event(struct notifier_block *notifier, static int ocrdma_inet6addr_event(struct notifier_block *notifier,
unsigned long event, void *ptr) unsigned long event, void *ptr)
...@@ -549,7 +548,7 @@ static struct ocrdma_driver ocrdma_drv = { ...@@ -549,7 +548,7 @@ static struct ocrdma_driver ocrdma_drv = {
static void ocrdma_unregister_inet6addr_notifier(void) static void ocrdma_unregister_inet6addr_notifier(void)
{ {
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier); unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
#endif #endif
} }
...@@ -558,7 +557,7 @@ static int __init ocrdma_init_module(void) ...@@ -558,7 +557,7 @@ static int __init ocrdma_init_module(void)
{ {
int status; int status;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier); status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier);
if (status) if (status)
return status; return status;
......
...@@ -1376,7 +1376,7 @@ static void ipoib_cm_skb_reap(struct work_struct *work) ...@@ -1376,7 +1376,7 @@ static void ipoib_cm_skb_reap(struct work_struct *work)
if (skb->protocol == htons(ETH_P_IP)) if (skb->protocol == htons(ETH_P_IP))
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if IS_ENABLED(CONFIG_IPV6)
else if (skb->protocol == htons(ETH_P_IPV6)) else if (skb->protocol == htons(ETH_P_IPV6))
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册