]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i40iw: Use runtime check for IS_ENABLED(CONFIG_IPV6)
authorHenry Orosco <henry.orosco@intel.com>
Thu, 10 Nov 2016 03:34:02 +0000 (21:34 -0600)
committerDoug Ledford <dledford@redhat.com>
Mon, 5 Dec 2016 21:09:37 +0000 (16:09 -0500)
To be consistent, use the runtime check instead of
conditional compile.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Henry Orosco <henry.orosco@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c

index cbd77eb303854bff5edc052af0f1f93450bb5bf6..b60e34653ec153627587e0006a855c647240b578 100644 (file)
@@ -1583,9 +1583,10 @@ static enum i40iw_status_code i40iw_del_multiple_qhash(
 static struct net_device *i40iw_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac)
 {
        struct net_device *ip_dev = NULL;
-#if IS_ENABLED(CONFIG_IPV6)
        struct in6_addr laddr6;
 
+       if (!IS_ENABLED(CONFIG_IPV6))
+               return NULL;
        i40iw_copy_ip_htonl(laddr6.in6_u.u6_addr32, addr);
        if (vlan_id)
                *vlan_id = I40IW_NO_VLAN;
@@ -1602,7 +1603,6 @@ static struct net_device *i40iw_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *ma
                }
        }
        rcu_read_unlock();
-#endif
        return ip_dev;
 }