diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-05-28 15:49:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-01 11:32:59 -0700 |
commit | bda6752f3de99e9d765638b89aacfb11c07cee06 (patch) | |
tree | 6a6d8717bb930c70505d6dc255a2d58a12939e29 /drivers/net | |
parent | d36ceaef8fc2e4ede43de425a7f503013b500e7f (diff) | |
download | lwn-bda6752f3de99e9d765638b89aacfb11c07cee06.tar.gz lwn-bda6752f3de99e9d765638b89aacfb11c07cee06.zip |
cxgb4: cleanup error code in setup_sge_queues_uld()
The caller doesn't care about the error codes, they only check for zero
vs non-zero. Still, it's better to preserve the negative error codes
from alloc_uld_rxqs() instead of changing it to 1. We can also return
directly if there is a failure.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c index 6b1d3df4b9ba..9e3c6b36cde8 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c @@ -174,13 +174,14 @@ static int setup_sge_queues_uld(struct adapter *adap, unsigned int uld_type, bool lro) { struct sge_uld_rxq_info *rxq_info = adap->sge.uld_rxq_info[uld_type]; - int i, ret = 0; + int i, ret; - ret = !(!alloc_uld_rxqs(adap, rxq_info, lro)); + ret = alloc_uld_rxqs(adap, rxq_info, lro); + if (ret) + return ret; /* Tell uP to route control queue completions to rdma rspq */ - if (adap->flags & CXGB4_FULL_INIT_DONE && - !ret && uld_type == CXGB4_ULD_RDMA) { + if (adap->flags & CXGB4_FULL_INIT_DONE && uld_type == CXGB4_ULD_RDMA) { struct sge *s = &adap->sge; unsigned int cmplqid; u32 param, cmdop; |