IB/mthca: Mark error paths as unlikely() in post_srq_recv functions
authorEli Cohen <eli@mellanox.co.il>
Wed, 10 Oct 2007 15:55:37 +0000 (17:55 +0200)
committerRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 18:24:33 +0000 (11:24 -0700)
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_srq.c

index 88d219e730ad5a2d773a6206512fabae40bd07a2..3f58c11a62b77f2618714e682ad8aea7bddf710a 100644 (file)
@@ -509,7 +509,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
        for (nreq = 0; wr; wr = wr->next) {
                ind = srq->first_free;
 
-               if (ind < 0) {
+               if (unlikely(ind < 0)) {
                        mthca_err(dev, "SRQ %06x full\n", srq->srqn);
                        err = -ENOMEM;
                        *bad_wr = wr;
@@ -519,7 +519,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
                wqe       = get_wqe(srq, ind);
                next_ind  = *wqe_to_link(wqe);
 
-               if (next_ind < 0) {
+               if (unlikely(next_ind < 0)) {
                        mthca_err(dev, "SRQ %06x full\n", srq->srqn);
                        err = -ENOMEM;
                        *bad_wr = wr;
@@ -623,7 +623,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
        for (nreq = 0; wr; ++nreq, wr = wr->next) {
                ind = srq->first_free;
 
-               if (ind < 0) {
+               if (unlikely(ind < 0)) {
                        mthca_err(dev, "SRQ %06x full\n", srq->srqn);
                        err = -ENOMEM;
                        *bad_wr = wr;
@@ -633,7 +633,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
                wqe       = get_wqe(srq, ind);
                next_ind  = *wqe_to_link(wqe);
 
-               if (next_ind < 0) {
+               if (unlikely(next_ind < 0)) {
                        mthca_err(dev, "SRQ %06x full\n", srq->srqn);
                        err = -ENOMEM;
                        *bad_wr = wr;