Commit 50cf156a authored by Yang Hongyang's avatar Yang Hongyang Committed by Linus Torvalds

dma-mapping: replace all DMA_40BIT_MASK macro with DMA_BIT_MASK(40)

Replace all DMA_40BIT_MASK macro with DMA_BIT_MASK(40)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e911e0d9
...@@ -90,7 +90,7 @@ int iommu_dma_supported(struct device *dev, u64 mask) ...@@ -90,7 +90,7 @@ int iommu_dma_supported(struct device *dev, u64 mask)
SAC for these. Assume all masks <= 40 bits are of this SAC for these. Assume all masks <= 40 bits are of this
type. Normally this doesn't make any difference, but gives type. Normally this doesn't make any difference, but gives
more gentle handling of IOMMU overflow. */ more gentle handling of IOMMU overflow. */
if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) { if (iommu_sac_force && (mask >= DMA_BIT_MASK(40))) {
dev_info(dev, "Force SAC with mask %lx\n", mask); dev_info(dev, "Force SAC with mask %lx\n", mask);
return 0; return 0;
} }
......
...@@ -258,7 +258,7 @@ int dma_supported(struct device *dev, u64 mask) ...@@ -258,7 +258,7 @@ int dma_supported(struct device *dev, u64 mask)
SAC for these. Assume all masks <= 40 bits are of this SAC for these. Assume all masks <= 40 bits are of this
type. Normally this doesn't make any difference, but gives type. Normally this doesn't make any difference, but gives
more gentle handling of IOMMU overflow. */ more gentle handling of IOMMU overflow. */
if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) { if (iommu_sac_force && (mask >= DMA_BIT_MASK(40))) {
dev_info(dev, "Force SAC with mask %Lx\n", mask); dev_info(dev, "Force SAC with mask %Lx\n", mask);
return 0; return 0;
} }
......
...@@ -7525,7 +7525,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -7525,7 +7525,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
/* 5708 cannot support DMA addresses > 40-bit. */ /* 5708 cannot support DMA addresses > 40-bit. */
if (CHIP_NUM(bp) == CHIP_NUM_5708) if (CHIP_NUM(bp) == CHIP_NUM_5708)
persist_dma_mask = dma_mask = DMA_40BIT_MASK; persist_dma_mask = dma_mask = DMA_BIT_MASK(40);
else else
persist_dma_mask = dma_mask = DMA_BIT_MASK(64); persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
......
...@@ -1685,7 +1685,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, ...@@ -1685,7 +1685,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
* fail to 32-bit. * fail to 32-bit.
*/ */
err = pci_set_dma_mask(pdev, DMA_40BIT_MASK); err = pci_set_dma_mask(pdev, DMA_BIT_MASK(40));
if (err) { if (err) {
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) { if (err) {
...@@ -1701,7 +1701,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, ...@@ -1701,7 +1701,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
goto err_out_release_regions; goto err_out_release_regions;
} }
} else { } else {
err = pci_set_consistent_dma_mask(pdev, DMA_40BIT_MASK); err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40));
if (err) { if (err) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"Unable to obtain 40-bit DMA " "Unable to obtain 40-bit DMA "
......
...@@ -2240,7 +2240,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev, ...@@ -2240,7 +2240,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
pci_set_master(pdev); pci_set_master(pdev);
rc = pci_set_dma_mask(pdev, DMA_40BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(40));
if (rc < 0) { if (rc < 0) {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc < 0) { if (rc < 0) {
......
...@@ -4975,7 +4975,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, ...@@ -4975,7 +4975,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
{ {
#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64) #if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG)
return (((u64) mapping + len) > DMA_40BIT_MASK); return (((u64) mapping + len) > DMA_BIT_MASK(40));
return 0; return 0;
#else #else
return 0; return 0;
...@@ -13230,7 +13230,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -13230,7 +13230,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
if (tp->tg3_flags2 & TG3_FLG2_IS_5788) if (tp->tg3_flags2 & TG3_FLG2_IS_5788)
persist_dma_mask = dma_mask = DMA_32BIT_MASK; persist_dma_mask = dma_mask = DMA_32BIT_MASK;
else if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) { else if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) {
persist_dma_mask = dma_mask = DMA_40BIT_MASK; persist_dma_mask = dma_mask = DMA_BIT_MASK(40);
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
dma_mask = DMA_BIT_MASK(64); dma_mask = DMA_BIT_MASK(64);
#endif #endif
...@@ -13394,7 +13394,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -13394,7 +13394,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n", printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n",
dev->name, tp->dma_rwctrl, dev->name, tp->dma_rwctrl,
(pdev->dma_mask == DMA_32BIT_MASK) ? 32 : (pdev->dma_mask == DMA_32BIT_MASK) ? 32 :
(((u64) pdev->dma_mask == DMA_40BIT_MASK) ? 40 : 64)); (((u64) pdev->dma_mask == DMA_BIT_MASK(40)) ? 40 : 64));
return 0; return 0;
......
...@@ -1087,7 +1087,7 @@ do { \ ...@@ -1087,7 +1087,7 @@ do { \
(data)->size = cpu_to_scr(len); \ (data)->size = cpu_to_scr(len); \
} while (0) } while (0)
#elif SYM_CONF_DMA_ADDRESSING_MODE == 1 #elif SYM_CONF_DMA_ADDRESSING_MODE == 1
#define DMA_DAC_MASK DMA_40BIT_MASK #define DMA_DAC_MASK DMA_BIT_MASK(40)
#define sym_build_sge(np, data, badd, len) \ #define sym_build_sge(np, data, badd, len) \
do { \ do { \
(data)->addr = cpu_to_scr(badd); \ (data)->addr = cpu_to_scr(badd); \
......
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