Skip to content

Commit

Permalink
i40e: Simplify the do-while allocation loop
Browse files Browse the repository at this point in the history
Fold the count decrement into the while-statement.

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Björn Töpel authored and Tony Nguyen committed Feb 12, 2021
1 parent 5c57e50 commit f892a9a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/intel/i40e/i40e_xsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count)
bi = i40e_rx_bi(rx_ring, 0);
ntu = 0;
}

count--;
} while (count);
} while (--count);

no_buffers:
if (rx_ring->next_to_use != ntu) {
Expand Down

0 comments on commit f892a9a

Please sign in to comment.