[IB] Have cq_resize() method take an int, not int*
authorRoland Dreier <rolandd@cisco.com>
Tue, 8 Nov 2005 19:10:25 +0000 (11:10 -0800)
committerRoland Dreier <rolandd@cisco.com>
Thu, 10 Nov 2005 18:22:50 +0000 (10:22 -0800)
Change the struct ib_device.resize_cq() method to take a plain integer
that holds the new CQ size, rather than a pointer to an integer that
it uses to return the new size.  This makes the interface match the
exported ib_resize_cq() signature, and allows the low-level driver to
update the CQ size with proper locking if necessary.

No in-tree drivers are exporting this method yet.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h

index 72d3ef786db50acf3194612b43bbe3910b5cc955..4f51d797f84aa6459a69ecf27844ac42358629bb 100644 (file)
@@ -324,16 +324,8 @@ EXPORT_SYMBOL(ib_destroy_cq);
 int ib_resize_cq(struct ib_cq *cq,
                  int           cqe)
 {
-       int ret;
-
-       if (!cq->device->resize_cq)
-               return -ENOSYS;
-
-       ret = cq->device->resize_cq(cq, &cqe);
-       if (!ret)
-               cq->cqe = cqe;
-
-       return ret;
+       return cq->device->resize_cq ?
+               cq->device->resize_cq(cq, cqe) : -ENOSYS;
 }
 EXPORT_SYMBOL(ib_resize_cq);
 
index f72d46d54e0a10560dc6b1eba9ccc81967a3b3c0..a7f4c355a91f76f0fbb8b41cc4edc0edb7b3d7e6 100644 (file)
@@ -881,7 +881,7 @@ struct ib_device {
                                                struct ib_ucontext *context,
                                                struct ib_udata *udata);
        int                        (*destroy_cq)(struct ib_cq *cq);
-       int                        (*resize_cq)(struct ib_cq *cq, int *cqe);
+       int                        (*resize_cq)(struct ib_cq *cq, int cqe);
        int                        (*poll_cq)(struct ib_cq *cq, int num_entries,
                                              struct ib_wc *wc);
        int                        (*peek_cq)(struct ib_cq *cq, int wc_cnt);