]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/hw/mthca/mthca_qp.c
IB/mthca: Use uninitialized_var() for f0
[linux-2.6] / drivers / infiniband / hw / mthca / mthca_qp.c
index 027664979fe2b1d5bff9e81539e6526a7fc71b86..0e9ef24f6638d428de406330da42ed5c18d3f82c 100644 (file)
@@ -1591,7 +1591,13 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
        int i;
        int size;
        int size0 = 0;
-       u32 f0;
+       /*
+        * f0 is only used if nreq != 0, and f0 will be initialized
+        * the first time through the main loop, since size0 == 0 the
+        * first time through.  So nreq cannot become non-zero without
+        * initializing f0, and f0 is in fact never used uninitialized.
+        */
+       u32 uninitialized_var(f0);
        int ind;
        u8 op0 = 0;
 
@@ -1946,7 +1952,13 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
        int i;
        int size;
        int size0 = 0;
-       u32 f0;
+       /*
+        * f0 is only used if nreq != 0, and f0 will be initialized
+        * the first time through the main loop, since size0 == 0 the
+        * first time through.  So nreq cannot become non-zero without
+        * initializing f0, and f0 is in fact never used uninitialized.
+        */
+       u32 uninitialized_var(f0);
        int ind;
        u8 op0 = 0;
 
@@ -2284,10 +2296,10 @@ void mthca_free_err_wqe(struct mthca_dev *dev, struct mthca_qp *qp, int is_send,
        struct mthca_next_seg *next;
 
        /*
-        * For SRQs, all WQEs generate a CQE, so we're always at the
-        * end of the doorbell chain.
+        * For SRQs, all receive WQEs generate a CQE, so we're always
+        * at the end of the doorbell chain.
         */
-       if (qp->ibqp.srq) {
+       if (qp->ibqp.srq && !is_send) {
                *new_wqe = 0;
                return;
        }