Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192473
b: refs/heads/master
c: 3a2baff
h: refs/heads/master
i:
  192471: fa21d71
v: v3
  • Loading branch information
FUJITA Tomonori authored and Roland Dreier committed Apr 21, 2010
1 parent 2300e9f commit 18cdbf5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9893e742a0d942dda2277e9f3e19b726900adf27
refs/heads/master: 3a2baff783497321e8322ce29f3a33a21c0d88f5
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,13 +1677,13 @@ int rdma_set_ib_paths(struct rdma_cm_id *id,
if (!cma_comp_exch(id_priv, CMA_ADDR_RESOLVED, CMA_ROUTE_RESOLVED))
return -EINVAL;

id->route.path_rec = kmemdup(path_rec, sizeof *path_rec * num_paths,
GFP_KERNEL);
id->route.path_rec = kmalloc(sizeof *path_rec * num_paths, GFP_KERNEL);
if (!id->route.path_rec) {
ret = -ENOMEM;
goto err;
}

memcpy(id->route.path_rec, path_rec, sizeof *path_rec * num_paths);
id->route.num_paths = num_paths;
return 0;
err:
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/infiniband/core/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,13 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
}

if (mad_reg_req) {
reg_req = kmemdup(mad_reg_req, sizeof *reg_req, GFP_KERNEL);
reg_req = kmalloc(sizeof *reg_req, GFP_KERNEL);
if (!reg_req) {
ret = ERR_PTR(-ENOMEM);
goto error3;
}
/* Make a copy of the MAD registration request */
memcpy(reg_req, mad_reg_req, sizeof *reg_req);
}

/* Now, fill in the various structures */
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/infiniband/hw/mthca/mthca_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct,
if (!buf->direct.buf)
return -ENOMEM;

pci_unmap_addr_set(&buf->direct, mapping, t);
dma_unmap_addr_set(&buf->direct, mapping, t);

memset(buf->direct.buf, 0, size);

Expand Down Expand Up @@ -251,7 +251,7 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct,
goto err_free;

dma_list[i] = t;
pci_unmap_addr_set(&buf->page_list[i], mapping, t);
dma_unmap_addr_set(&buf->page_list[i], mapping, t);

clear_page(buf->page_list[i].buf);
}
Expand Down Expand Up @@ -289,12 +289,12 @@ void mthca_buf_free(struct mthca_dev *dev, int size, union mthca_buf *buf,

if (is_direct)
dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf,
pci_unmap_addr(&buf->direct, mapping));
dma_unmap_addr(&buf->direct, mapping));
else {
for (i = 0; i < (size + PAGE_SIZE - 1) / PAGE_SIZE; ++i)
dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
buf->page_list[i].buf,
pci_unmap_addr(&buf->page_list[i],
dma_unmap_addr(&buf->page_list[i],
mapping));
kfree(buf->page_list);
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/hw/mthca/mthca_eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ static int mthca_create_eq(struct mthca_dev *dev,
goto err_out_free_pages;

dma_list[i] = t;
pci_unmap_addr_set(&eq->page_list[i], mapping, t);
dma_unmap_addr_set(&eq->page_list[i], mapping, t);

clear_page(eq->page_list[i].buf);
}
Expand Down Expand Up @@ -579,7 +579,7 @@ static int mthca_create_eq(struct mthca_dev *dev,
if (eq->page_list[i].buf)
dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
eq->page_list[i].buf,
pci_unmap_addr(&eq->page_list[i],
dma_unmap_addr(&eq->page_list[i],
mapping));

mthca_free_mailbox(dev, mailbox);
Expand Down Expand Up @@ -629,7 +629,7 @@ static void mthca_free_eq(struct mthca_dev *dev,
for (i = 0; i < npages; ++i)
pci_free_consistent(dev->pdev, PAGE_SIZE,
eq->page_list[i].buf,
pci_unmap_addr(&eq->page_list[i], mapping));
dma_unmap_addr(&eq->page_list[i], mapping));

kfree(eq->page_list);
mthca_free_mailbox(dev, mailbox);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

struct mthca_buf_list {
void *buf;
DECLARE_PCI_UNMAP_ADDR(mapping)
DEFINE_DMA_UNMAP_ADDR(mapping);
};

union mthca_buf {
Expand Down

0 comments on commit 18cdbf5

Please sign in to comment.