[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>
This commit is contained in:
committed by
Linus Torvalds
parent
a852092e8c
commit
a03a5a67b2
@@ -918,9 +918,9 @@ void mthca_free_cq(struct mthca_dev *dev,
|
||||
if (mthca_is_memfree(dev)) {
|
||||
mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index);
|
||||
mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index);
|
||||
mthca_table_put(dev, dev->cq_table.table, cq->cqn);
|
||||
}
|
||||
|
||||
mthca_table_put(dev, dev->cq_table.table, cq->cqn);
|
||||
mthca_free(&dev->cq_table.alloc, cq->cqn);
|
||||
kfree(mailbox);
|
||||
}
|
||||
|
Reference in New Issue
Block a user