net/ixgbe/base: use 8 bits for PCI functions
authorBeilei Xing <beilei.xing@intel.com>
Thu, 23 Jun 2016 07:22:32 +0000 (15:22 +0800)
committerBruce Richardson <bruce.richardson@intel.com>
Mon, 27 Jun 2016 14:17:53 +0000 (16:17 +0200)
Since PCIe standard defines maximum of 8 functions per device lan_id
is a value 0..7. Because of that, lan_id don't need to be u16.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/ixgbe/base/ixgbe_common.c
drivers/net/ixgbe/base/ixgbe_type.h

index 80ea3b9..6e54628 100644 (file)
@@ -1034,7 +1034,7 @@ void ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw)
 
        reg = IXGBE_READ_REG(hw, IXGBE_STATUS);
        bus->func = (reg & IXGBE_STATUS_LAN_ID) >> IXGBE_STATUS_LAN_ID_SHIFT;
-       bus->lan_id = bus->func;
+       bus->lan_id = (u8)bus->func;
 
        /* check for a port swap */
        reg = IXGBE_READ_REG(hw, IXGBE_FACTPS_BY_MAC(hw));
index 3bf0de0..d91c4ed 100644 (file)
@@ -3684,7 +3684,7 @@ struct ixgbe_bus_info {
        enum ixgbe_bus_type type;
 
        u16 func;
-       u16 lan_id;
+       u8 lan_id;
        u16 instance_id;
 };