aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_cq.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-01-31 23:45:51 -0500
committerRoland Dreier <rolandd@cisco.com>2006-03-20 13:08:07 -0500
commitd9b98b0f11ee7dd39429001ba289f095b9d66917 (patch)
treec473a7b348640cb80c4584ef5ea8dd055efed577 /drivers/infiniband/hw/mthca/mthca_cq.c
parent7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff)
IB/mthca: Make functions that never fail return void
The function mthca_free_err_wqe() can never fail, so get rid of its return value. That means handle_error_cqe() doesn't have to check what mthca_free_err_wqe() returns, which means it can't fail either and doesn't have to return anything either. All this results in simpler source code and a slight object code improvement: add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-10 (-10) function old new delta mthca_free_err_wqe 83 81 -2 mthca_poll_cq 1758 1750 -8 Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cq.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 96f1a86bf049..16a851b341f8 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -324,12 +324,11 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn,
324 wake_up(&cq->wait); 324 wake_up(&cq->wait);
325} 325}
326 326
327static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq, 327static void handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
328 struct mthca_qp *qp, int wqe_index, int is_send, 328 struct mthca_qp *qp, int wqe_index, int is_send,
329 struct mthca_err_cqe *cqe, 329 struct mthca_err_cqe *cqe,
330 struct ib_wc *entry, int *free_cqe) 330 struct ib_wc *entry, int *free_cqe)
331{ 331{
332 int err;
333 int dbd; 332 int dbd;
334 __be32 new_wqe; 333 __be32 new_wqe;
335 334
@@ -412,11 +411,9 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
412 * error case, so we don't have to check the doorbell count, etc. 411 * error case, so we don't have to check the doorbell count, etc.
413 */ 412 */
414 if (mthca_is_memfree(dev)) 413 if (mthca_is_memfree(dev))
415 return 0; 414 return;
416 415
417 err = mthca_free_err_wqe(dev, qp, is_send, wqe_index, &dbd, &new_wqe); 416 mthca_free_err_wqe(dev, qp, is_send, wqe_index, &dbd, &new_wqe);
418 if (err)
419 return err;
420 417
421 /* 418 /*
422 * If we're at the end of the WQE chain, or we've used up our 419 * If we're at the end of the WQE chain, or we've used up our
@@ -424,15 +421,13 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
424 * the next poll operation. 421 * the next poll operation.
425 */ 422 */
426 if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd)) 423 if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
427 return 0; 424 return;
428 425
429 cqe->db_cnt = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd); 426 cqe->db_cnt = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);
430 cqe->wqe = new_wqe; 427 cqe->wqe = new_wqe;
431 cqe->syndrome = SYNDROME_WR_FLUSH_ERR; 428 cqe->syndrome = SYNDROME_WR_FLUSH_ERR;
432 429
433 *free_cqe = 0; 430 *free_cqe = 0;
434
435 return 0;
436} 431}
437 432
438static inline int mthca_poll_one(struct mthca_dev *dev, 433static inline int mthca_poll_one(struct mthca_dev *dev,
@@ -518,9 +513,9 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
518 } 513 }
519 514
520 if (is_error) { 515 if (is_error) {
521 err = handle_error_cqe(dev, cq, *cur_qp, wqe_index, is_send, 516 handle_error_cqe(dev, cq, *cur_qp, wqe_index, is_send,
522 (struct mthca_err_cqe *) cqe, 517 (struct mthca_err_cqe *) cqe,
523 entry, &free_cqe); 518 entry, &free_cqe);
524 goto out; 519 goto out;
525 } 520 }
526 521