diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-06-22 16:25:58 -0400 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-06-22 16:25:58 -0400 |
commit | b46a58fd4e3cdd107ffccedaa5e233deeb94c5c0 (patch) | |
tree | 20bcd914f4eb8f7b8150cb7a9fdfb7f31828c4c9 /arch/arm/common/dmabounce.c | |
parent | bdf042486a01aefaf29d74be1b4526daa70a5f0f (diff) |
[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: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/dmabounce.c')
-rw-r--r-- | arch/arm/common/dmabounce.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 9d63a01214eb..cbf2165476b0 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -93,15 +93,12 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info) | |||
93 | static inline struct dmabounce_device_info * | 93 | static inline struct dmabounce_device_info * |
94 | find_dmabounce_dev(struct device *dev) | 94 | find_dmabounce_dev(struct device *dev) |
95 | { | 95 | { |
96 | struct list_head *entry; | 96 | struct dmabounce_device_info *d; |
97 | |||
98 | list_for_each(entry, &dmabounce_devs) { | ||
99 | struct dmabounce_device_info *d = | ||
100 | list_entry(entry, struct dmabounce_device_info, node); | ||
101 | 97 | ||
98 | list_for_each_entry(d, &dmabounce_devs, node) | ||
102 | if (d->dev == dev) | 99 | if (d->dev == dev) |
103 | return d; | 100 | return d; |
104 | } | 101 | |
105 | return NULL; | 102 | return NULL; |
106 | } | 103 | } |
107 | 104 | ||
@@ -172,15 +169,11 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, | |||
172 | static inline struct safe_buffer * | 169 | static inline struct safe_buffer * |
173 | find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) | 170 | find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) |
174 | { | 171 | { |
175 | struct list_head *entry; | 172 | struct safe_buffer *b; |
176 | |||
177 | list_for_each(entry, &device_info->safe_buffers) { | ||
178 | struct safe_buffer *b = | ||
179 | list_entry(entry, struct safe_buffer, node); | ||
180 | 173 | ||
174 | list_for_each_entry(b, &device_info->safe_buffers, node) | ||
181 | if (b->safe_dma_addr == safe_dma_addr) | 175 | if (b->safe_dma_addr == safe_dma_addr) |
182 | return b; | 176 | return b; |
183 | } | ||
184 | 177 | ||
185 | return NULL; | 178 | return NULL; |
186 | } | 179 | } |
@@ -301,7 +294,6 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
301 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), | 294 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), |
302 | buf->safe, (void *) buf->safe_dma_addr); | 295 | buf->safe, (void *) buf->safe_dma_addr); |
303 | 296 | ||
304 | |||
305 | DO_STATS ( device_info->bounce_count++ ); | 297 | DO_STATS ( device_info->bounce_count++ ); |
306 | 298 | ||
307 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { | 299 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { |