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_qp.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_qp.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index c62e7cf0ca3c..a92e870dfb97 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -1111,11 +1111,12 @@ static void mthca_free_memfree(struct mthca_dev *dev, | |||
1111 | if (mthca_is_memfree(dev)) { | 1111 | if (mthca_is_memfree(dev)) { |
1112 | mthca_free_db(dev, MTHCA_DB_TYPE_SQ, qp->sq.db_index); | 1112 | mthca_free_db(dev, MTHCA_DB_TYPE_SQ, qp->sq.db_index); |
1113 | mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); | 1113 | mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); |
1114 | mthca_table_put(dev, dev->qp_table.rdb_table, | ||
1115 | qp->qpn << dev->qp_table.rdb_shift); | ||
1116 | mthca_table_put(dev, dev->qp_table.eqp_table, qp->qpn); | ||
1117 | mthca_table_put(dev, dev->qp_table.qp_table, qp->qpn); | ||
1118 | } | 1114 | } |
1115 | |||
1116 | mthca_table_put(dev, dev->qp_table.rdb_table, | ||
1117 | qp->qpn << dev->qp_table.rdb_shift); | ||
1118 | mthca_table_put(dev, dev->qp_table.eqp_table, qp->qpn); | ||
1119 | mthca_table_put(dev, dev->qp_table.qp_table, qp->qpn); | ||
1119 | } | 1120 | } |
1120 | 1121 | ||
1121 | static void mthca_wq_init(struct mthca_wq* wq) | 1122 | static void mthca_wq_init(struct mthca_wq* wq) |