Commit 06993ca6bc46419027b45198a58447f4f05c14f6

Authored by Bryan O'Sullivan
Committed by Linus Torvalds
1 parent 0ed9a4a0b6

[PATCH] IB/ipath: use vmalloc to allocate struct ipath_devdata

This is not a DMA target, so no need to use dma_alloc_coherent on it.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 3 additions and 8 deletions Side-by-side Diff

drivers/infiniband/hw/ipath/ipath_driver.c
... ... @@ -171,14 +171,13 @@
171 171 list_del(&dd->ipath_list);
172 172 spin_unlock_irqrestore(&ipath_devs_lock, flags);
173 173 }
174   - dma_free_coherent(&pdev->dev, sizeof(*dd), dd, dd->ipath_dma_addr);
  174 + vfree(dd);
175 175 }
176 176  
177 177 static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
178 178 {
179 179 unsigned long flags;
180 180 struct ipath_devdata *dd;
181   - dma_addr_t dma_addr;
182 181 int ret;
183 182  
184 183 if (!idr_pre_get(&unit_table, GFP_KERNEL)) {
185 184  
... ... @@ -186,15 +185,12 @@
186 185 goto bail;
187 186 }
188 187  
189   - dd = dma_alloc_coherent(&pdev->dev, sizeof(*dd), &dma_addr,
190   - GFP_KERNEL);
191   -
  188 + dd = vmalloc(sizeof(*dd));
192 189 if (!dd) {
193 190 dd = ERR_PTR(-ENOMEM);
194 191 goto bail;
195 192 }
196   -
197   - dd->ipath_dma_addr = dma_addr;
  193 + memset(dd, 0, sizeof(*dd));
198 194 dd->ipath_unit = -1;
199 195  
200 196 spin_lock_irqsave(&ipath_devs_lock, flags);
drivers/infiniband/hw/ipath/ipath_kernel.h
... ... @@ -163,7 +163,6 @@
163 163 * only written to by the chip, not the driver.
164 164 */
165 165 volatile __le64 *ipath_hdrqtailptr;
166   - dma_addr_t ipath_dma_addr;
167 166 /* ipath_cfgports pointers */
168 167 struct ipath_portdata **ipath_pd;
169 168 /* sk_buffs used by port 0 eager receive queue */