]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: use logical operators, not bitwise
authorMitch Williams <mitch.a.williams@intel.com>
Thu, 14 Jan 2016 00:51:50 +0000 (16:51 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:23 +0000 (08:37 -0800)
Orabug: 22342532

Mr. Spock would certainly raise an eyebrow to see us using bitwise
operators, when we should clearly be relying on logic. Fascinating.

Change-ID: Ie338010c016f93e9faa2002c07c90b15134b7477
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1a36d7fadd1477761dc8b4fc8910d1defc31fad5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index c138e40df773f20dd1151dd150c71a96b9e83fbb..25b9244fffcad39da6beda59da24168d63b97f7d 100644 (file)
@@ -1999,7 +1999,8 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
         * budget and be more aggressive about cleaning up the Tx descriptors.
         */
        i40e_for_each_ring(ring, q_vector->tx) {
-               clean_complete &= i40e_clean_tx_irq(ring, vsi->work_limit);
+               clean_complete = clean_complete &&
+                                i40e_clean_tx_irq(ring, vsi->work_limit);
                arm_wb = arm_wb || ring->arm_wb;
                ring->arm_wb = false;
        }
@@ -2019,7 +2020,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
                else
                        cleaned = i40e_clean_rx_irq_1buf(ring, budget_per_ring);
                /* if we didn't clean as many as budgeted, we must be done */
-               clean_complete &= (budget_per_ring != cleaned);
+               clean_complete = clean_complete && (budget_per_ring > cleaned);
        }
 
        /* If work not completed, return budget and polling will return */
index 9c93dbe4fc87ab6c900852697cf24696ed65fae6..755b1c3e6897e3fa753e3e7a0c4a43aaf807d8a1 100644 (file)
@@ -1435,7 +1435,8 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
         * budget and be more aggressive about cleaning up the Tx descriptors.
         */
        i40e_for_each_ring(ring, q_vector->tx) {
-               clean_complete &= i40e_clean_tx_irq(ring, vsi->work_limit);
+               clean_complete = clean_complete &&
+                                i40e_clean_tx_irq(ring, vsi->work_limit);
                arm_wb = arm_wb || ring->arm_wb;
                ring->arm_wb = false;
        }
@@ -1455,7 +1456,7 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
                else
                        cleaned = i40e_clean_rx_irq_1buf(ring, budget_per_ring);
                /* if we didn't clean as many as budgeted, we must be done */
-               clean_complete &= (budget_per_ring != cleaned);
+               clean_complete = clean_complete && (budget_per_ring > cleaned);
        }
 
        /* If work not completed, return budget and polling will return */