aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/fmr_pool.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-07-14 03:23:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:51 -0400
commitadfaa888a292e7f38fb43668d8994f246e371f0f (patch)
treeb84155cedf9a1361ff4f7b0586c9b0be702ca605 /drivers/infiniband/core/fmr_pool.c
parent74f76fbac72c84ac78620698a584d403b655e62a (diff)
[PATCH] fmr pool: remove unnecessary pointer dereference
ib_fmr_pool_map_phys gets the virtual address by pointer but never writes there, and users (e.g. srp) seem to assume this and ignore the value returned. This patch cleans up the API to get the VA by value, and updates all users. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Acked-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/core/fmr_pool.c')
-rw-r--r--drivers/infiniband/core/fmr_pool.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c
index 615fe9cc6c56..86a3b2d401db 100644
--- a/drivers/infiniband/core/fmr_pool.c
+++ b/drivers/infiniband/core/fmr_pool.c
@@ -426,7 +426,7 @@ EXPORT_SYMBOL(ib_flush_fmr_pool);
426struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, 426struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
427 u64 *page_list, 427 u64 *page_list,
428 int list_len, 428 int list_len,
429 u64 *io_virtual_address) 429 u64 io_virtual_address)
430{ 430{
431 struct ib_fmr_pool *pool = pool_handle; 431 struct ib_fmr_pool *pool = pool_handle;
432 struct ib_pool_fmr *fmr; 432 struct ib_pool_fmr *fmr;
@@ -440,7 +440,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
440 fmr = ib_fmr_cache_lookup(pool, 440 fmr = ib_fmr_cache_lookup(pool,
441 page_list, 441 page_list,
442 list_len, 442 list_len,
443 *io_virtual_address); 443 io_virtual_address);
444 if (fmr) { 444 if (fmr) {
445 /* found in cache */ 445 /* found in cache */
446 ++fmr->ref_count; 446 ++fmr->ref_count;
@@ -464,7 +464,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
464 spin_unlock_irqrestore(&pool->pool_lock, flags); 464 spin_unlock_irqrestore(&pool->pool_lock, flags);
465 465
466 result = ib_map_phys_fmr(fmr->fmr, page_list, list_len, 466 result = ib_map_phys_fmr(fmr->fmr, page_list, list_len,
467 *io_virtual_address); 467 io_virtual_address);
468 468
469 if (result) { 469 if (result) {
470 spin_lock_irqsave(&pool->pool_lock, flags); 470 spin_lock_irqsave(&pool->pool_lock, flags);
@@ -481,7 +481,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
481 fmr->ref_count = 1; 481 fmr->ref_count = 1;
482 482
483 if (pool->cache_bucket) { 483 if (pool->cache_bucket) {
484 fmr->io_virtual_address = *io_virtual_address; 484 fmr->io_virtual_address = io_virtual_address;
485 fmr->page_list_len = list_len; 485 fmr->page_list_len = list_len;
486 memcpy(fmr->page_list, page_list, list_len * sizeof(*page_list)); 486 memcpy(fmr->page_list, page_list, list_len * sizeof(*page_list));
487 487