Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1203c42e7be1aa0be641b701f42b6d38c2d94b39
Commit:     1203c42e7be1aa0be641b701f42b6d38c2d94b39
Parent:     1d96354e617990799b1cb5d7ff8f7c467b8767c8
Author:     Eli Cohen <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 20:20:44 2008 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 20:20:44 2008 -0800

    IB/mthca: Remove checks for srq->first_free < 0
    
    The SRQ receive posting functions make sure that srq->first_free never
    becomes negative, so we can remove tests of whether it is negative.
    
    Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mthca/mthca_srq.c |   26 +++-----------------------
 1 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c 
b/drivers/infiniband/hw/mthca/mthca_srq.c
index 553d681..ec63adc 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -475,11 +475,7 @@ void mthca_free_srq_wqe(struct mthca_srq *srq, u32 
wqe_addr)
 
        spin_lock(&srq->lock);
 
-       if (likely(srq->first_free >= 0))
-               *wqe_to_link(get_wqe(srq, srq->last_free)) = ind;
-       else
-               srq->first_free = ind;
-
+       *wqe_to_link(get_wqe(srq, srq->last_free)) = ind;
        *wqe_to_link(get_wqe(srq, ind)) = -1;
        srq->last_free = ind;
 
@@ -506,15 +502,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct 
ib_recv_wr *wr,
        first_ind = srq->first_free;
 
        for (nreq = 0; wr; wr = wr->next) {
-               ind = srq->first_free;
-
-               if (unlikely(ind < 0)) {
-                       mthca_err(dev, "SRQ %06x full\n", srq->srqn);
-                       err = -ENOMEM;
-                       *bad_wr = wr;
-                       break;
-               }
-
+               ind       = srq->first_free;
                wqe       = get_wqe(srq, ind);
                next_ind  = *wqe_to_link(wqe);
 
@@ -614,15 +602,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct 
ib_recv_wr *wr,
        spin_lock_irqsave(&srq->lock, flags);
 
        for (nreq = 0; wr; ++nreq, wr = wr->next) {
-               ind = srq->first_free;
-
-               if (unlikely(ind < 0)) {
-                       mthca_err(dev, "SRQ %06x full\n", srq->srqn);
-                       err = -ENOMEM;
-                       *bad_wr = wr;
-                       break;
-               }
-
+               ind       = srq->first_free;
                wqe       = get_wqe(srq, ind);
                next_ind  = *wqe_to_link(wqe);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to