ice: Remove duplicate code in ice_alloc_rx_bufs
authorBrett Creeley <brett.creeley@intel.com>
Wed, 26 Jun 2019 09:20:23 +0000 (02:20 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 31 Jul 2019 20:40:52 +0000 (13:40 -0700)
commita1e9968593234c179fcb3e71875897ae585c8362
tree0a5118fa25d0fa5238cba8c054d8b507989ed9a2
parent56923ab66467c2edbd1ff97240ff14805e0b1cdc
ice: Remove duplicate code in ice_alloc_rx_bufs

Currently if the call to ice_alloc_mapped_page() fails we jump to the
no_buf label, possibly call ice_release_rx_desc(), and return true
indicating that there is more work to do. In the success case we just
fall out of the while loop, possibly call ice_alloc_mapped_page(), and
return false saying we exhausted cleaned_count. This flow can be
improved by breaking if ice_alloc_mapped_page() fails and then the flow
outside of the while loop is the same for the failure and success case.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_txrx.c