net/ena/base: simplify loop copying Rx descriptors
authorMichal Krawczyk <mk@semihalf.com>
Thu, 17 Sep 2020 05:30:32 +0000 (07:30 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:09 +0000 (19:19 +0200)
commit074262f6c16808c6a350021fbc2568058a42cb6e
treed905cb804592a5f253f38c1c0991e5c3f6402582
parent3c7e44c7d3d460a642b5e907ef2f674a0c121a65
net/ena/base: simplify loop copying Rx descriptors

Checking for the cdesc not being NULL doesn't have any sense if the idx
argument is not 0, so it can be skipped, as the error won't be detected
anyway.

To simplify that, only the 'i' value is being verified and the code is
breaking from the infinite loop in case when all descriptors were copied
into the buffer.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/ena/base/ena_eth_com.c