From: Matthias Gehre Replace all occurences of 0xff.. in calls to function pci_set_dma_mask() and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from linux/dma-mapping.h. Signed-off-by: Matthias Gehre Signed-off-by: Andrew Morton --- Documentation/DMA-mapping.txt | 2 ++ drivers/atm/lanai.c | 2 +- drivers/block/umem.c | 5 +++-- drivers/net/forcedeth.c | 3 ++- drivers/net/ioc3-eth.c | 7 ++++--- drivers/net/ns83820.c | 6 +++--- drivers/net/wan/wanxl.c | 4 ++-- drivers/net/wireless/prism54/islpci_hotplug.c | 3 ++- drivers/scsi/BusLogic.c | 7 ++++--- drivers/scsi/a100u2w.c | 3 ++- drivers/scsi/aacraid/aachba.c | 1 + drivers/scsi/aacraid/linit.c | 5 +++-- drivers/scsi/atp870u.c | 3 ++- drivers/scsi/dpt_i2o.c | 5 +++-- drivers/scsi/eata.c | 3 ++- drivers/scsi/gdth.c | 7 ++++--- drivers/scsi/initio.c | 3 ++- drivers/scsi/ips.c | 5 +++-- drivers/scsi/megaraid.c | 7 ++++--- drivers/scsi/nsp32.c | 3 ++- drivers/scsi/qla1280.c | 5 +++-- drivers/scsi/qlogicfc.c | 5 +++-- include/linux/dma-mapping.h | 2 ++ sound/oss/esssolo1.c | 2 +- sound/oss/sonicvibes.c | 3 ++- sound/pci/ad1889.c | 5 +++-- sound/pci/ali5451/ali5451.c | 5 +++-- sound/pci/als4000.c | 5 +++-- sound/pci/azt3328.c | 5 +++-- sound/pci/emu10k1/emu10k1x.c | 5 +++-- sound/pci/es1938.c | 5 +++-- sound/pci/es1968.c | 5 +++-- sound/pci/ice1712/ice1712.c | 6 ++++-- sound/pci/maestro3.c | 5 +++-- sound/pci/mixart/mixart.c | 4 +++- sound/pci/pcxhr/pcxhr.c | 3 ++- sound/pci/sonicvibes.c | 5 +++-- sound/pci/trident/trident_main.c | 5 +++-- 38 files changed, 101 insertions(+), 63 deletions(-) diff -puN Documentation/DMA-mapping.txt~replace-0xff-with-correct-dma_xbit_mask Documentation/DMA-mapping.txt --- devel/Documentation/DMA-mapping.txt~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/Documentation/DMA-mapping.txt 2006-02-02 19:58:24.000000000 -0800 @@ -199,6 +199,8 @@ address during PCI bus mastering you mig "mydev: 24-bit DMA addressing not available.\n"); goto ignore_this_device; } +[Better use DMA_24BIT_MASK instead of 0x00ffffff. +See linux/include/dma-mapping.h for reference.] When pci_set_dma_mask() is successful, and returns zero, the PCI layer saves away this mask you have provided. The PCI layer will use this diff -puN drivers/atm/lanai.c~replace-0xff-with-correct-dma_xbit_mask drivers/atm/lanai.c --- devel/drivers/atm/lanai.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/atm/lanai.c 2006-02-02 19:58:24.000000000 -0800 @@ -1972,7 +1972,7 @@ static int __devinit lanai_pci_start(str "(itf %d): No suitable DMA available.\n", lanai->number); return -EBUSY; } - if (pci_set_consistent_dma_mask(pci, 0xFFFFFFFF) != 0) { + if (pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) != 0) { printk(KERN_WARNING DEV_LABEL "(itf %d): No suitable DMA available.\n", lanai->number); return -EBUSY; diff -puN drivers/block/umem.c~replace-0xff-with-correct-dma_xbit_mask drivers/block/umem.c --- devel/drivers/block/umem.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/block/umem.c 2006-02-02 19:58:24.000000000 -0800 @@ -50,6 +50,7 @@ #include #include #include +#include #include /* O_ACCMODE */ #include /* HDIO_GETGEO */ @@ -881,8 +882,8 @@ static int __devinit mm_pci_probe(struct printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n", card->card_number, dev->bus->number, dev->devfn); - if (pci_set_dma_mask(dev, 0xffffffffffffffffLL) && - pci_set_dma_mask(dev, 0xffffffffLL)) { + if (pci_set_dma_mask(dev, DMA_64BIT_MASK) && + pci_set_dma_mask(dev, DMA_32BIT_MASK)) { printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards); return -ENOMEM; } diff -puN drivers/net/forcedeth.c~replace-0xff-with-correct-dma_xbit_mask drivers/net/forcedeth.c --- devel/drivers/net/forcedeth.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/net/forcedeth.c 2006-02-02 19:58:24.000000000 -0800 @@ -131,6 +131,7 @@ #include #include #include +#include #include #include @@ -2467,7 +2468,7 @@ static int __devinit nv_probe(struct pci if (id->driver_data & DEV_HAS_HIGH_DMA) { /* packet format 3: supports 40-bit addressing */ np->desc_ver = DESC_VER_3; - if (pci_set_dma_mask(pci_dev, 0x0000007fffffffffULL)) { + if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) { printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n", pci_name(pci_dev)); } else { diff -puN drivers/net/ioc3-eth.c~replace-0xff-with-correct-dma_xbit_mask drivers/net/ioc3-eth.c --- devel/drivers/net/ioc3-eth.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/net/ioc3-eth.c 2006-02-02 19:58:24.000000000 -0800 @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef CONFIG_SERIAL_8250 #include @@ -1195,17 +1196,17 @@ static int ioc3_probe(struct pci_dev *pd int err, pci_using_dac; /* Configure DMA attributes. */ - err = pci_set_dma_mask(pdev, 0xffffffffffffffffULL); + err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); if (!err) { pci_using_dac = 1; - err = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL); + err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); if (err < 0) { printk(KERN_ERR "%s: Unable to obtain 64 bit DMA " "for consistent allocations\n", pci_name(pdev)); goto out; } } else { - err = pci_set_dma_mask(pdev, 0xffffffffULL); + err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (err) { printk(KERN_ERR "%s: No usable DMA configuration, " "aborting.\n", pci_name(pdev)); diff -puN drivers/net/ns83820.c~replace-0xff-with-correct-dma_xbit_mask drivers/net/ns83820.c --- devel/drivers/net/ns83820.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/net/ns83820.c 2006-02-02 19:58:24.000000000 -0800 @@ -1828,10 +1828,10 @@ static int __devinit ns83820_init_one(st int using_dac = 0; /* See if we can set the dma mask early on; failure is fatal. */ - if (sizeof(dma_addr_t) == 8 && - !pci_set_dma_mask(pci_dev, 0xffffffffffffffffULL)) { + if (sizeof(dma_addr_t) == 8 && + !pci_set_dma_mask(pci_dev, DMA_64BIT_MASK)) { using_dac = 1; - } else if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { + } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { using_dac = 0; } else { printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n"); diff -puN drivers/net/wan/wanxl.c~replace-0xff-with-correct-dma_xbit_mask drivers/net/wan/wanxl.c --- devel/drivers/net/wan/wanxl.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/net/wan/wanxl.c 2006-02-02 19:58:24.000000000 -0800 @@ -577,8 +577,8 @@ static int __devinit wanxl_pci_init_one( We set both dma_mask and consistent_dma_mask to 28 bits and pray pci_alloc_consistent() will use this info. It should work on most platforms */ - if (pci_set_consistent_dma_mask(pdev, 0x0FFFFFFF) || - pci_set_dma_mask(pdev, 0x0FFFFFFF)) { + if (pci_set_consistent_dma_mask(pdev, DMA_28BIT_MASK) || + pci_set_dma_mask(pdev, DMA_28BIT_MASK)) { printk(KERN_ERR "wanXL: No usable DMA configuration\n"); return -EIO; } diff -puN drivers/net/wireless/prism54/islpci_hotplug.c~replace-0xff-with-correct-dma_xbit_mask drivers/net/wireless/prism54/islpci_hotplug.c --- devel/drivers/net/wireless/prism54/islpci_hotplug.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/net/wireless/prism54/islpci_hotplug.c 2006-02-02 19:58:24.000000000 -0800 @@ -22,6 +22,7 @@ #include #include #include /* For __init, __exit */ +#include #include "prismcompat.h" #include "islpci_dev.h" @@ -124,7 +125,7 @@ prism54_probe(struct pci_dev *pdev, cons } /* enable PCI DMA */ - if (pci_set_dma_mask(pdev, 0xffffffff)) { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_ERR "%s: 32-bit PCI DMA not supported", DRV_NAME); goto do_pci_disable_device; } diff -puN drivers/scsi/a100u2w.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/a100u2w.c --- devel/drivers/scsi/a100u2w.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/a100u2w.c 2006-02-02 19:58:24.000000000 -0800 @@ -89,6 +89,7 @@ #include #include #include +#include #include #include @@ -1052,7 +1053,7 @@ static int __devinit inia100_probe_one(s if (pci_enable_device(pdev)) goto out; - if (pci_set_dma_mask(pdev, 0xffffffffULL)) { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "Unable to set 32bit DMA " "on inia100 adapter, ignoring.\n"); goto out_disable_device; diff -puN drivers/scsi/aacraid/aachba.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/aacraid/aachba.c --- devel/drivers/scsi/aacraid/aachba.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/aacraid/aachba.c 2006-02-02 19:58:24.000000000 -0800 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff -puN drivers/scsi/aacraid/linit.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/aacraid/linit.c --- devel/drivers/scsi/aacraid/linit.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/aacraid/linit.c 2006-02-02 19:58:24.000000000 -0800 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -777,8 +778,8 @@ static int __devinit aac_probe_one(struc * to driver communication memory to be allocated below 2gig */ if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) - if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) || - pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL)) + if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) || + pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK)) goto out; pci_set_master(pdev); diff -puN drivers/scsi/atp870u.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/atp870u.c --- devel/drivers/scsi/atp870u.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/atp870u.c 2006-02-02 19:58:24.000000000 -0800 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -2631,7 +2632,7 @@ static int atp870u_probe(struct pci_dev if (pci_enable_device(pdev)) return -EIO; - if (!pci_set_dma_mask(pdev, 0xFFFFFFFFUL)) { + if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_INFO "atp870u: use 32bit DMA mask.\n"); } else { printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); diff -puN drivers/scsi/BusLogic.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/BusLogic.c --- devel/drivers/scsi/BusLogic.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/BusLogic.c 2006-02-02 19:58:24.000000000 -0800 @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -677,7 +678,7 @@ static int __init BusLogic_InitializeMul if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK )) continue; Bus = PCI_Device->bus->number; @@ -832,7 +833,7 @@ static int __init BusLogic_InitializeMul if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK)) continue; Bus = PCI_Device->bus->number; @@ -886,7 +887,7 @@ static int __init BusLogic_InitializeFla if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK)) continue; Bus = PCI_Device->bus->number; diff -puN drivers/scsi/dpt_i2o.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/dpt_i2o.c --- devel/drivers/scsi/dpt_i2o.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/dpt_i2o.c 2006-02-02 19:58:24.000000000 -0800 @@ -57,6 +57,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Dri #include #include #include +#include #include #include @@ -906,8 +907,8 @@ static int adpt_install_hba(struct scsi_ } pci_set_master(pDev); - if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && - pci_set_dma_mask(pDev, 0xffffffffULL)) + if (pci_set_dma_mask(pDev, DMA_64BIT_MASK) && + pci_set_dma_mask(pDev, DMA_32BIT_MASK)) return -EINVAL; base_addr0_phys = pci_resource_start(pDev,0); diff -puN drivers/scsi/eata.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/eata.c --- devel/drivers/scsi/eata.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/eata.c 2006-02-02 19:58:24.000000000 -0800 @@ -490,6 +490,7 @@ #include #include #include +#include #include #include #include @@ -1426,7 +1427,7 @@ static int port_detect(unsigned long por if (ha->pdev) { pci_set_master(ha->pdev); - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) printk("%s: warning, pci_set_dma_mask failed.\n", ha->board_name); } diff -puN drivers/scsi/gdth.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/gdth.c --- devel/drivers/scsi/gdth.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/gdth.c 2006-02-02 19:58:24.000000000 -0800 @@ -388,6 +388,7 @@ #include #include #include +#include #ifdef GDTH_RTC #include #endif @@ -4527,15 +4528,15 @@ static int __init gdth_detect(struct scs if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| /* 64-bit DMA only supported from FW >= x.43 */ (!ha->dma64_support)) { - if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { + if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum); err = TRUE; } } else { shp->max_cmd_len = 16; - if (!pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffffffffffffULL)) { + if (!pci_set_dma_mask(pcistr[ctr].pdev, DMA_64BIT_MASK)) { printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum); - } else if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { + } else if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum); err = TRUE; } diff -puN drivers/scsi/initio.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/initio.c --- devel/drivers/scsi/initio.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/initio.c 2006-02-02 19:58:24.000000000 -0800 @@ -127,6 +127,7 @@ #include #include #include +#include #include #include @@ -2780,7 +2781,7 @@ static int tul_NewReturnNumberOfAdapters if (((dRegValue & 0xFF00) >> 8) == 0xFF) dRegValue = 0; wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8)); - if (pci_set_dma_mask(pDev, 0xffffffff)) { + if (pci_set_dma_mask(pDev, DMA_32BIT_MASK)) { printk(KERN_WARNING "i91u: Could not set 32 bit DMA mask\n"); continue; diff -puN drivers/scsi/ips.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/ips.c --- devel/drivers/scsi/ips.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/ips.c 2006-02-02 19:58:24.000000000 -0800 @@ -179,6 +179,7 @@ #include #include +#include #include @@ -7284,10 +7285,10 @@ ips_init_phase1(struct pci_dev *pci_dev, * are guaranteed to be < 4G. */ if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) && - !pci_set_dma_mask(ha->pcidev, 0xffffffffffffffffULL)) { + !pci_set_dma_mask(ha->pcidev, DMA_64BIT_MASK)) { (ha)->flags |= IPS_HA_ENH_SG; } else { - if (pci_set_dma_mask(ha->pcidev, 0xffffffffULL) != 0) { + if (pci_set_dma_mask(ha->pcidev, DMA_32BIT_MASK) != 0) { printk(KERN_WARNING "Unable to set DMA Mask\n"); return ips_abort_init(ha, index); } diff -puN drivers/scsi/megaraid.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/megaraid.c --- devel/drivers/scsi/megaraid.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/megaraid.c 2006-02-02 19:58:24.000000000 -0800 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include "scsi.h" @@ -2094,7 +2095,7 @@ make_local_pdev(adapter_t *adapter, stru memcpy(*pdev, adapter->dev, sizeof(struct pci_dev)); - if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) { + if( pci_set_dma_mask(*pdev, DMA_32BIT_MASK) != 0 ) { kfree(*pdev); return -1; } @@ -4862,10 +4863,10 @@ megaraid_probe_one(struct pci_dev *pdev, /* Set the Mode of addressing to 64 bit if we can */ if ((adapter->flag & BOARD_64BIT) && (sizeof(dma_addr_t) == 8)) { - pci_set_dma_mask(pdev, 0xffffffffffffffffULL); + pci_set_dma_mask(pdev, DMA_64BIT_MASK); adapter->has_64bit_addr = 1; } else { - pci_set_dma_mask(pdev, 0xffffffff); + pci_set_dma_mask(pdev, DMA_32BIT_MASK); adapter->has_64bit_addr = 0; } diff -puN drivers/scsi/nsp32.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/nsp32.c --- devel/drivers/scsi/nsp32.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/nsp32.c 2006-02-02 19:58:24.000000000 -0800 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -2776,7 +2777,7 @@ static int nsp32_detect(struct scsi_host /* * setup DMA */ - if (pci_set_dma_mask(PCIDEV, 0xffffffffUL) != 0) { + if (pci_set_dma_mask(PCIDEV, DMA_32BIT_MASK) != 0) { nsp32_msg (KERN_ERR, "failed to set PCI DMA mask"); goto scsi_unregister; } diff -puN drivers/scsi/qla1280.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/qla1280.c --- devel/drivers/scsi/qla1280.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/qla1280.c 2006-02-02 19:58:24.000000000 -0800 @@ -350,6 +350,7 @@ #include #include #include +#include #include #include @@ -4321,7 +4322,7 @@ qla1280_probe_one(struct pci_dev *pdev, #ifdef QLA_64BIT_PTR if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) { - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n", ha->host_no); error = -ENODEV; @@ -4331,7 +4332,7 @@ qla1280_probe_one(struct pci_dev *pdev, dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n", ha->host_no); #else - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n", ha->host_no); error = -ENODEV; diff -puN drivers/scsi/qlogicfc.c~replace-0xff-with-correct-dma_xbit_mask drivers/scsi/qlogicfc.c --- devel/drivers/scsi/qlogicfc.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/drivers/scsi/qlogicfc.c 2006-02-02 19:58:24.000000000 -0800 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -738,8 +739,8 @@ static int isp2x00_detect(struct scsi_ho continue; /* Try to configure DMA attributes. */ - if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) && - pci_set_dma_mask(pdev, 0xffffffffULL)) + if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) && + pci_set_dma_mask(pdev, DMA_32BIT_MASK)) continue; host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata)); diff -puN include/linux/dma-mapping.h~replace-0xff-with-correct-dma_xbit_mask include/linux/dma-mapping.h --- devel/include/linux/dma-mapping.h~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/include/linux/dma-mapping.h 2006-02-02 19:58:24.000000000 -0800 @@ -20,6 +20,8 @@ enum dma_data_direction { #define DMA_31BIT_MASK 0x000000007fffffffULL #define DMA_30BIT_MASK 0x000000003fffffffULL #define DMA_29BIT_MASK 0x000000001fffffffULL +#define DMA_28BIT_MASK 0x000000000fffffffULL +#define DMA_24BIT_MASK 0x0000000000ffffffULL #include diff -puN sound/oss/esssolo1.c~replace-0xff-with-correct-dma_xbit_mask sound/oss/esssolo1.c --- devel/sound/oss/esssolo1.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/oss/esssolo1.c 2006-02-02 19:58:24.000000000 -0800 @@ -2348,7 +2348,7 @@ static int __devinit solo1_probe(struct /* Recording requires 24-bit DMA, so attempt to set dma mask * to 24 bits first, then 32 bits (playback only) if that fails. */ - if (pci_set_dma_mask(pcidev, 0x00ffffff) && + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK) && pci_set_dma_mask(pcidev, DMA_32BIT_MASK)) { printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n"); return -ENODEV; diff -puN sound/oss/sonicvibes.c~replace-0xff-with-correct-dma_xbit_mask sound/oss/sonicvibes.c --- devel/sound/oss/sonicvibes.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/oss/sonicvibes.c 2006-02-02 19:58:24.000000000 -0800 @@ -116,6 +116,7 @@ #include #include #include +#include #include @@ -2553,7 +2554,7 @@ static int __devinit sv_probe(struct pci return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - if (pci_set_dma_mask(pcidev, 0x00ffffff)) { + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK)) { printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n"); return -ENODEV; } diff -puN sound/pci/ad1889.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/ad1889.c --- devel/sound/pci/ad1889.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/ad1889.c 2006-02-02 19:58:24.000000000 -0800 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -911,8 +912,8 @@ snd_ad1889_create(struct snd_card *card, return err; /* check PCI availability (32bit DMA) */ - if (pci_set_dma_mask(pci, 0xffffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0xffffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/ali5451/ali5451.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/ali5451/ali5451.c --- devel/sound/pci/ali5451/ali5451.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/ali5451/ali5451.c 2006-02-02 19:58:24.000000000 -0800 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -2220,8 +2221,8 @@ static int __devinit snd_ali_create(stru if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 31 bits */ - if (pci_set_dma_mask(pci, 0x7fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_31BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_31BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 31bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/als4000.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/als4000.c --- devel/sound/pci/als4000.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/als4000.c 2006-02-02 19:58:24.000000000 -0800 @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -688,8 +689,8 @@ static int __devinit snd_card_als4000_pr return err; } /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/azt3328.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/azt3328.c --- devel/sound/pci/azt3328.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/azt3328.c 2006-02-02 19:58:24.000000000 -0800 @@ -104,6 +104,7 @@ #include #include #include +#include #include #include #include @@ -1669,8 +1670,8 @@ snd_azf3328_create(struct snd_card *card chip->irq = -1; /* check if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); err = -ENXIO; goto out_err; diff -puN sound/pci/emu10k1/emu10k1x.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/emu10k1/emu10k1x.c --- devel/sound/pci/emu10k1/emu10k1x.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/emu10k1/emu10k1x.c 2006-02-02 19:58:24.000000000 -0800 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -898,8 +899,8 @@ static int __devinit snd_emu10k1x_create if ((err = pci_enable_device(pci)) < 0) return err; - if (pci_set_dma_mask(pci, 0x0fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { snd_printk(KERN_ERR "error to set 28bit mask DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/es1938.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/es1938.c --- devel/sound/pci/es1938.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/es1938.c 2006-02-02 19:58:24.000000000 -0800 @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -1517,8 +1518,8 @@ static int __devinit snd_es1938_create(s if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/es1968.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/es1968.c --- devel/sound/pci/es1968.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/es1968.c 2006-02-02 19:58:24.000000000 -0800 @@ -103,6 +103,7 @@ #include #include #include +#include #include #include @@ -2561,8 +2562,8 @@ static int __devinit snd_es1968_create(s if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 28 bits */ - if (pci_set_dma_mask(pci, 0x0fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/ice1712/ice1712.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/ice1712/ice1712.c --- devel/sound/pci/ice1712/ice1712.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/ice1712/ice1712.c 2006-02-02 19:58:24.000000000 -0800 @@ -55,7 +55,9 @@ #include #include #include +#include #include + #include #include #include @@ -2540,8 +2542,8 @@ static int __devinit snd_ice1712_create( if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 28 bits */ - if (pci_set_dma_mask(pci, 0x0fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/maestro3.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/maestro3.c --- devel/sound/pci/maestro3.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/maestro3.c 2006-02-02 19:58:24.000000000 -0800 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -2657,8 +2658,8 @@ snd_m3_create(struct snd_card *card, str return -EIO; /* check, if we can restrict PCI DMA transfers to 28 bits */ - if (pci_set_dma_mask(pci, 0x0fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/mixart/mixart.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/mixart/mixart.c --- devel/sound/pci/mixart/mixart.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/mixart/mixart.c 2006-02-02 19:58:24.000000000 -0800 @@ -27,6 +27,8 @@ #include #include #include +#include + #include #include #include @@ -1289,7 +1291,7 @@ static int __devinit snd_mixart_probe(st pci_set_master(pci); /* check if we can restrict PCI DMA transfers to 32 bits */ - if (pci_set_dma_mask(pci, 0xffffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/pcxhr/pcxhr.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/pcxhr/pcxhr.c --- devel/sound/pci/pcxhr/pcxhr.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/pcxhr/pcxhr.c 2006-02-02 19:58:24.000000000 -0800 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -1217,7 +1218,7 @@ static int __devinit pcxhr_probe(struct pci_set_master(pci); /* check if we can restrict PCI DMA transfers to 32 bits */ - if (pci_set_dma_mask(pci, 0xffffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/sonicvibes.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/sonicvibes.c --- devel/sound/pci/sonicvibes.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/sonicvibes.c 2006-02-02 19:58:24.000000000 -0800 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1227,8 +1228,8 @@ static int __devinit snd_sonicvibes_crea if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff -puN sound/pci/trident/trident_main.c~replace-0xff-with-correct-dma_xbit_mask sound/pci/trident/trident_main.c --- devel/sound/pci/trident/trident_main.c~replace-0xff-with-correct-dma_xbit_mask 2006-02-02 19:58:24.000000000 -0800 +++ devel-akpm/sound/pci/trident/trident_main.c 2006-02-02 19:58:24.000000000 -0800 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -3554,8 +3555,8 @@ int __devinit snd_trident_create(struct if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 30 bits */ - if (pci_set_dma_mask(pci, 0x3fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_30BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_30BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; _