diff options
author | Roland Dreier <roland@topspin.com> | 2005-06-27 17:36:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 18:11:45 -0400 |
commit | a03a5a67b243e9a24805ee18272ad25e5b2ca92c (patch) | |
tree | 5e4a1d3ec8482a482caa6697cba12a819ef6aa8a /drivers/infiniband/hw/mthca/mthca_cq.c | |
parent | a852092e8cb305595ff630dfc3e9b25966a98276 (diff) |
[PATCH] IB/mthca: Move mthca_is_memfree checks
Make mthca_table_put() and mthca_table_put_range() NOPs if the device is not
mem-free, so that we don't have to have "if (mthca_is_memfree())" tests in the
callers of these functions. This makes our code more readable and
maintainable, and saves a couple dozen bytes of text in ib_mthca.ko as well.
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cq.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c index 5dae5b5dc8e7..505d059216e9 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c | |||
@@ -918,9 +918,9 @@ void mthca_free_cq(struct mthca_dev *dev, | |||
918 | if (mthca_is_memfree(dev)) { | 918 | if (mthca_is_memfree(dev)) { |
919 | mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index); | 919 | mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index); |
920 | mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index); | 920 | mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index); |
921 | mthca_table_put(dev, dev->cq_table.table, cq->cqn); | ||
922 | } | 921 | } |
923 | 922 | ||
923 | mthca_table_put(dev, dev->cq_table.table, cq->cqn); | ||
924 | mthca_free(&dev->cq_table.alloc, cq->cqn); | 924 | mthca_free(&dev->cq_table.alloc, cq->cqn); |
925 | kfree(mailbox); | 925 | kfree(mailbox); |
926 | } | 926 | } |