Commit b46a58fd authored by Russell King's avatar Russell King

[PATCH] ARM: Use list_for_each_entry() for dmabounce

Convert dmabounce.c to use list_for_each_entry() instead of
list_for_each() + list_entry().
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent bdf04248
...@@ -93,15 +93,12 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info) ...@@ -93,15 +93,12 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info)
static inline struct dmabounce_device_info * static inline struct dmabounce_device_info *
find_dmabounce_dev(struct device *dev) find_dmabounce_dev(struct device *dev)
{ {
struct list_head *entry; struct dmabounce_device_info *d;
list_for_each(entry, &dmabounce_devs) {
struct dmabounce_device_info *d =
list_entry(entry, struct dmabounce_device_info, node);
list_for_each_entry(d, &dmabounce_devs, node)
if (d->dev == dev) if (d->dev == dev)
return d; return d;
}
return NULL; return NULL;
} }
...@@ -172,15 +169,11 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, ...@@ -172,15 +169,11 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
static inline struct safe_buffer * static inline struct safe_buffer *
find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr)
{ {
struct list_head *entry; struct safe_buffer *b;
list_for_each(entry, &device_info->safe_buffers) {
struct safe_buffer *b =
list_entry(entry, struct safe_buffer, node);
list_for_each_entry(b, &device_info->safe_buffers, node)
if (b->safe_dma_addr == safe_dma_addr) if (b->safe_dma_addr == safe_dma_addr)
return b; return b;
}
return NULL; return NULL;
} }
...@@ -301,7 +294,6 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, ...@@ -301,7 +294,6 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
__func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
buf->safe, (void *) buf->safe_dma_addr); buf->safe, (void *) buf->safe_dma_addr);
DO_STATS ( device_info->bounce_count++ ); DO_STATS ( device_info->bounce_count++ );
if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment