Commit 56899e69 authored by James Bottomley's avatar James Bottomley

aic7xxx: fix compiler warning from dma mask assignement

Promote all the mask quantites to being u64 so that
they never cause truncation warnings.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 99877aae
......@@ -540,7 +540,7 @@ struct ahd_platform_data {
uint32_t irq; /* IRQ for this adapter */
uint32_t bios_address;
uint32_t mem_busaddr; /* Mem Base Addr */
dma_addr_t hw_dma_mask;
uint64_t hw_dma_mask;
ahd_linux_softc_flags flags;
};
......
......@@ -170,24 +170,22 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (sizeof(dma_addr_t) > 4) {
uint64_t memsize;
dma_addr_t mask_64bit;
dma_addr_t mask_39bit;
const uint64_t mask_39bit = 0x7FFFFFFFFFULL;
memsize = ahd_linux_get_memsize();
mask_64bit = (dma_addr_t)0xFFFFFFFFFFFFFFFFULL;
mask_39bit = (dma_addr_t)0x7FFFFFFFFFULL;
if (memsize >= 0x8000000000ULL
&& pci_set_dma_mask(pdev, mask_64bit) == 0) {
&& pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
ahd->flags |= AHD_64BIT_ADDRESSING;
ahd->platform_data->hw_dma_mask = mask_64bit;
ahd->platform_data->hw_dma_mask = DMA_64BIT_MASK;
} else if (memsize > 0x80000000
&& pci_set_dma_mask(pdev, mask_39bit) == 0) {
ahd->flags |= AHD_39BIT_ADDRESSING;
ahd->platform_data->hw_dma_mask = mask_39bit;
}
} else {
pci_set_dma_mask(pdev, 0xFFFFFFFF);
ahd->platform_data->hw_dma_mask = 0xFFFFFFFF;
pci_set_dma_mask(pdev, DMA_32BIT_MASK);
ahd->platform_data->hw_dma_mask = DMA_32BIT_MASK;
}
ahd->dev_softc = pci;
error = ahd_pci_config(ahd, entry);
......
......@@ -545,7 +545,7 @@ struct ahc_platform_data {
uint32_t irq; /* IRQ for this adapter */
uint32_t bios_address;
uint32_t mem_busaddr; /* Mem Base Addr */
dma_addr_t hw_dma_mask;
uint64_t hw_dma_mask;
ahc_linux_softc_flags flags;
};
......
......@@ -175,7 +175,7 @@ static int
ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
char buf[80];
dma_addr_t mask_39bit;
const uint64_t mask_39bit = 0x7FFFFFFFFFULL;
struct ahc_softc *ahc;
ahc_dev_softc_t pci;
struct ahc_pci_identity *entry;
......@@ -226,18 +226,17 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
pci_set_master(pdev);
mask_39bit = 0x7FFFFFFFFFULL;
if (sizeof(dma_addr_t) > 4
&& ahc_linux_get_memsize() > 0x80000000
&& pci_set_dma_mask(pdev, mask_39bit) == 0) {
ahc->flags |= AHC_39BIT_ADDRESSING;
ahc->platform_data->hw_dma_mask = mask_39bit;
} else {
if (pci_set_dma_mask(pdev, 0xFFFFFFFF)) {
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
return (-ENODEV);
}
ahc->platform_data->hw_dma_mask = 0xFFFFFFFF;
ahc->platform_data->hw_dma_mask = DMA_32BIT_MASK;
}
#endif
ahc->dev_softc = pci;
......
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