Skip to content

Commit

Permalink
[PATCH] Move valid_dma_direction() from x86_64 to generic code
Browse files Browse the repository at this point in the history
As suggested by Muli Ben-Yehuda this function is moved to generic code as
may be useful for all archs.

[akpm@osdl.org: fix]
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rolf Eike Beer authored and Linus Torvalds committed Sep 29, 2006
1 parent d09d7dd commit d6bd3a3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion arch/x86_64/kernel/pci-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <linux/pci.h>
#include <linux/cache.h>
#include <linux/module.h>
#include <asm/dma-mapping.h>
#include <linux/dma-mapping.h>

#include <asm/proto.h>
#include <asm/swiotlb.h>
#include <asm/dma.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/fec_8xx/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <linux/dma-mapping.h>

#include <asm/8xx_immap.h>
#include <asm/pgtable.h>
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/commproc.h>
#include <asm/dma-mapping.h>

#include "fec_8xx.h"

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/fs_enet/fs_enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
#include <linux/types.h>
#include <linux/list.h>
#include <linux/phy.h>
#include <linux/dma-mapping.h>

#include <linux/fs_enet_pd.h>

#include <asm/dma-mapping.h>

#ifdef CONFIG_CPM1
#include <asm/commproc.h>

Expand Down
7 changes: 0 additions & 7 deletions include/asm-x86_64/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ extern dma_addr_t bad_dma_address;
extern struct dma_mapping_ops* dma_ops;
extern int iommu_merge;

static inline int valid_dma_direction(int dma_direction)
{
return ((dma_direction == DMA_BIDIRECTIONAL) ||
(dma_direction == DMA_TO_DEVICE) ||
(dma_direction == DMA_FROM_DEVICE));
}

static inline int dma_mapping_error(dma_addr_t dma_addr)
{
if (dma_ops->mapping_error)
Expand Down
7 changes: 7 additions & 0 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ enum dma_data_direction {
#define DMA_28BIT_MASK 0x000000000fffffffULL
#define DMA_24BIT_MASK 0x0000000000ffffffULL

static inline int valid_dma_direction(int dma_direction)
{
return ((dma_direction == DMA_BIDIRECTIONAL) ||
(dma_direction == DMA_TO_DEVICE) ||
(dma_direction == DMA_FROM_DEVICE));
}

#include <asm/dma-mapping.h>

/* Backwards compat, remove in 2.7.x */
Expand Down

0 comments on commit d6bd3a3

Please sign in to comment.