]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: remove mismatched type warnings
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Tue, 20 Jun 2017 22:16:59 +0000 (15:16 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:25 +0000 (14:15 -0700)
Compiler reported several places where driver compared
signed and unsigned types.  Cast or change the types to remove
the warnings.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit b85c94b617c0004d1f2bd6ca32baa9132a6c2fe5)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c

index 9fa9b2d26bb19b73f8eef03e35ea15b829054f74..6211d362e8c96e44373308cd906dc4780278a3f7 100644 (file)
@@ -1068,7 +1068,7 @@ static void i40e_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
        struct i40e_pf *pf = np->vsi->back;
        struct i40e_hw *hw = &pf->hw;
        u32 *reg_buf = p;
-       int i, j, ri;
+       unsigned int i, j, ri;
        u32 reg;
 
        /* Tell ethtool which driver-version-specific regs output we have.
@@ -1503,9 +1503,9 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
        struct i40e_ring *tx_ring, *rx_ring;
        struct i40e_vsi *vsi = np->vsi;
        struct i40e_pf *pf = vsi->back;
+       unsigned int j;
        int i = 0;
        char *p;
-       int j;
        struct rtnl_link_stats64 *net_stats = i40e_get_vsi_stats_struct(vsi);
        unsigned int start;
 
@@ -1591,7 +1591,7 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
        struct i40e_vsi *vsi = np->vsi;
        struct i40e_pf *pf = vsi->back;
        char *p = (char *)data;
-       int i;
+       unsigned int i;
 
        switch (stringset) {
        case ETH_SS_TEST:
index b2d1157e0da42c41818259d2c887e0b3c9a1b0d9..89034100cd273469c10743aced27e2c96caaea32 100644 (file)
@@ -4694,7 +4694,7 @@ static void i40e_detect_recover_hung(struct i40e_pf *pf)
 {
        struct net_device *netdev;
        struct i40e_vsi *vsi;
-       int i;
+       unsigned int i;
 
        /* Only for LAN VSI */
        vsi = pf->vsi[pf->lan_vsi];
index 3810fc7e43f2b1ac03667a1aecc2edb41a2e3c37..9b5115b4e77cc83b527c1e3be4f945d71642eb2f 100644 (file)
@@ -850,7 +850,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
        netdev_tx_completed_queue(txring_txq(tx_ring),
                                  total_packets, total_bytes);
 
-#define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
+#define TX_WAKE_THRESHOLD ((s16)(DESC_NEEDED * 2))
        if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) &&
                     (I40E_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))) {
                /* Make sure that anybody stopping the queue after this
@@ -1902,7 +1902,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
        u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
        bool failure = false;
 
-       while (likely(total_rx_packets < budget)) {
+       while (likely(total_rx_packets < (unsigned int)budget)) {
                struct i40e_rx_buffer *rx_buffer;
                union i40e_rx_desc *rx_desc;
                unsigned int size;
@@ -2010,7 +2010,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
        rx_ring->q_vector->rx.total_bytes += total_rx_bytes;
 
        /* guarantee a trip back through this routine if there was a failure */
-       return failure ? budget : total_rx_packets;
+       return failure ? budget : (int)total_rx_packets;
 }
 
 static u32 i40e_buildreg_itr(const int type, const u16 itr)
index b5fc622f65499c30ee41a71b197770040744d186..d385931003b2637915f2fca89a667f6e66fa90f2 100644 (file)
@@ -274,7 +274,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
        netdev_tx_completed_queue(txring_txq(tx_ring),
                                  total_packets, total_bytes);
 
-#define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
+#define TX_WAKE_THRESHOLD ((s16)(DESC_NEEDED * 2))
        if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) &&
                     (I40E_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))) {
                /* Make sure that anybody stopping the queue after this
@@ -1237,7 +1237,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
        u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
        bool failure = false;
 
-       while (likely(total_rx_packets < budget)) {
+       while (likely(total_rx_packets < (unsigned int)budget)) {
                struct i40e_rx_buffer *rx_buffer;
                union i40e_rx_desc *rx_desc;
                unsigned int size;
@@ -1333,7 +1333,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
        rx_ring->q_vector->rx.total_bytes += total_rx_bytes;
 
        /* guarantee a trip back through this routine if there was a failure */
-       return failure ? budget : total_rx_packets;
+       return failure ? budget : (int)total_rx_packets;
 }
 
 static u32 i40e_buildreg_itr(const int type, const u16 itr)
index 77a6e3a516aba165718046b1527a63a31e91bf95..61863534a433ffe273de0a735b095719f0d10003 100644 (file)
@@ -166,7 +166,7 @@ static void i40evf_get_ethtool_stats(struct net_device *netdev,
                                     struct ethtool_stats *stats, u64 *data)
 {
        struct i40evf_adapter *adapter = netdev_priv(netdev);
-       int i, j;
+       unsigned int i, j;
        char *p;
 
        for (i = 0; i < I40EVF_GLOBAL_STATS_LEN; i++) {
@@ -198,7 +198,7 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
        int i;
 
        if (sset == ETH_SS_STATS) {
-               for (i = 0; i < I40EVF_GLOBAL_STATS_LEN; i++) {
+               for (i = 0; i < (int)I40EVF_GLOBAL_STATS_LEN; i++) {
                        memcpy(p, i40evf_gstrings_stats[i].stat_string,
                               ETH_GSTRING_LEN);
                        p += ETH_GSTRING_LEN;