kni: fix build with 802.1p kernel support
authorThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 7 Feb 2013 13:07:47 +0000 (14:07 +0100)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 10:07:28 +0000 (11:07 +0100)
C90 compilers forbid mixed declaration and code.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c

index 85de817..947be44 100644 (file)
@@ -314,6 +314,9 @@ void ixgbe_vlan_mode(struct net_device *netdev, u32 features)
 #endif
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
+#ifdef HAVE_8021P_SUPPORT
+       bool enable;
+#endif
 #ifdef HAVE_VLAN_RX_REGISTER
 
        //if (!test_bit(__IXGBE_DOWN, &adapter->state))
@@ -326,9 +329,9 @@ void ixgbe_vlan_mode(struct net_device *netdev, u32 features)
 #endif
 #ifdef HAVE_8021P_SUPPORT
 #ifdef HAVE_VLAN_RX_REGISTER
-       bool enable = (grp || (adapter->flags & IXGBE_FLAG_DCB_ENABLED));
+       enable = (grp || (adapter->flags & IXGBE_FLAG_DCB_ENABLED));
 #else
-       bool enable = !!(features & NETIF_F_HW_VLAN_RX);
+       enable = !!(features & NETIF_F_HW_VLAN_RX);
 #endif
        if (enable)
                /* enable VLAN tag insert/strip */