Skip to content

Commit

Permalink
[PATCH] dma-mapping.h stubs fix
Browse files Browse the repository at this point in the history
do { } while(0) is not a good imitation of function returning void;
use ((void)0) instead.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 30, 2007
1 parent d0a2339 commit 6a13f66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/asm-alpha/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
#define dma_map_single(dev, va, size, dir) virt_to_phys(va)
#define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off)

#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
#define dma_unmap_page(dev, addr, size, dir) do { } while (0)
#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0)
#define dma_unmap_single(dev, addr, size, dir) ((void)0)
#define dma_unmap_page(dev, addr, size, dir) ((void)0)
#define dma_unmap_sg(dev, sg, nents, dir) ((void)0)

#define dma_mapping_error(addr) (0)

Expand Down
12 changes: 6 additions & 6 deletions include/asm-powerpc/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
*/

#define __dma_alloc_coherent(gfp, size, handle) NULL
#define __dma_free_coherent(size, addr) do { } while (0)
#define __dma_sync(addr, size, rw) do { } while (0)
#define __dma_sync_page(pg, off, sz, rw) do { } while (0)
#define __dma_free_coherent(size, addr) ((void)0)
#define __dma_sync(addr, size, rw) ((void)0)
#define __dma_sync_page(pg, off, sz, rw) ((void)0)

#endif /* ! CONFIG_NOT_COHERENT_CACHE */

Expand Down Expand Up @@ -251,7 +251,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
}

/* We do nothing. */
#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
#define dma_unmap_single(dev, addr, size, dir) ((void)0)

static inline dma_addr_t
dma_map_page(struct device *dev, struct page *page,
Expand All @@ -266,7 +266,7 @@ dma_map_page(struct device *dev, struct page *page,
}

/* We do nothing. */
#define dma_unmap_page(dev, handle, size, dir) do { } while (0)
#define dma_unmap_page(dev, handle, size, dir) ((void)0)

static inline int
dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
Expand All @@ -286,7 +286,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
}

/* We don't do anything here. */
#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0)
#define dma_unmap_sg(dev, sg, nents, dir) ((void)0)

#endif /* CONFIG_PPC64 */

Expand Down

0 comments on commit 6a13f66

Please sign in to comment.