OSDN Git Service

ixgbe: Change the lan_id and func fields to a u8 to avoid casts
authorMark Rustad <mark.d.rustad@intel.com>
Mon, 14 Mar 2016 18:05:46 +0000 (11:05 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 7 Apr 2016 22:26:31 +0000 (15:26 -0700)
Since the lan_id and func fields only ever hold small values, make
them u8 to avoid casts used to silence warnings.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index 8c7e78b..dfdb114 100644 (file)
@@ -3600,7 +3600,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
        fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
        fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN;
        fw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;
-       fw_cmd.port_num = (u8)hw->bus.func;
+       fw_cmd.port_num = hw->bus.func;
        fw_cmd.ver_maj = maj;
        fw_cmd.ver_min = min;
        fw_cmd.ver_build = build;
index d02a0a3..7ae4bbd 100644 (file)
@@ -3122,8 +3122,8 @@ struct ixgbe_bus_info {
        enum ixgbe_bus_width width;
        enum ixgbe_bus_type type;
 
-       u16 func;
-       u16 lan_id;
+       u8 func;
+       u8 lan_id;
 };
 
 /* Flow control parameters */
index 9d3f765..5affac1 100644 (file)
@@ -862,7 +862,7 @@ static void ixgbe_disable_rx_x550(struct ixgbe_hw *hw)
                fw_cmd.hdr.cmd = FW_DISABLE_RXEN_CMD;
                fw_cmd.hdr.buf_len = FW_DISABLE_RXEN_LEN;
                fw_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
-               fw_cmd.port_number = (u8)hw->bus.lan_id;
+               fw_cmd.port_number = hw->bus.lan_id;
 
                status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,
                                        sizeof(struct ixgbe_hic_disable_rxen),