Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235280
b: refs/heads/master
c: 0828376
h: refs/heads/master
v: v3
  • Loading branch information
Tobias Ollmann authored and Greg Kroah-Hartman committed Jan 23, 2011
1 parent 41e7b99 commit 8feec3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 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: 60678b60d78cd268a3aed3044dfbbb85760b2c54
refs/heads/master: 0828376deadb93f2e839900065f536ddc1190e73
26 changes: 13 additions & 13 deletions trunk/drivers/usb/core/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/mm.h>
#include <asm/io.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/usb.h>
Expand All @@ -22,7 +22,7 @@
*/

/* FIXME tune these based on pool statistics ... */
static const size_t pool_max [HCD_BUFFER_POOLS] = {
static const size_t pool_max[HCD_BUFFER_POOLS] = {
/* platforms without dma-friendly caches might need to
* prevent cacheline sharing...
*/
Expand Down Expand Up @@ -51,7 +51,7 @@ static const size_t pool_max [HCD_BUFFER_POOLS] = {
int hcd_buffer_create(struct usb_hcd *hcd)
{
char name[16];
int i, size;
int i, size;

if (!hcd->self.controller->dma_mask &&
!(hcd->driver->flags & HCD_LOCAL_MEM))
Expand All @@ -64,7 +64,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
snprintf(name, sizeof name, "buffer-%d", size);
hcd->pool[i] = dma_pool_create(name, hcd->self.controller,
size, size, 0);
if (!hcd->pool [i]) {
if (!hcd->pool[i]) {
hcd_buffer_destroy(hcd);
return -ENOMEM;
}
Expand Down Expand Up @@ -99,14 +99,14 @@ void hcd_buffer_destroy(struct usb_hcd *hcd)
*/

void *hcd_buffer_alloc(
struct usb_bus *bus,
struct usb_bus *bus,
size_t size,
gfp_t mem_flags,
dma_addr_t *dma
)
{
struct usb_hcd *hcd = bus_to_hcd(bus);
int i;
int i;

/* some USB hosts just use PIO */
if (!bus->controller->dma_mask &&
Expand All @@ -116,21 +116,21 @@ void *hcd_buffer_alloc(
}

for (i = 0; i < HCD_BUFFER_POOLS; i++) {
if (size <= pool_max [i])
return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
if (size <= pool_max[i])
return dma_pool_alloc(hcd->pool[i], mem_flags, dma);
}
return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
}

void hcd_buffer_free(
struct usb_bus *bus,
struct usb_bus *bus,
size_t size,
void *addr,
void *addr,
dma_addr_t dma
)
{
struct usb_hcd *hcd = bus_to_hcd(bus);
int i;
int i;

if (!addr)
return;
Expand All @@ -142,8 +142,8 @@ void hcd_buffer_free(
}

for (i = 0; i < HCD_BUFFER_POOLS; i++) {
if (size <= pool_max [i]) {
dma_pool_free(hcd->pool [i], addr, dma);
if (size <= pool_max[i]) {
dma_pool_free(hcd->pool[i], addr, dma);
return;
}
}
Expand Down

0 comments on commit 8feec3c

Please sign in to comment.