public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* aic7xxx driver large integer warning
@ 2004-12-06  0:23 Miguel Angel Flores
  2004-12-06 13:31 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Angel Flores @ 2004-12-06  0:23 UTC (permalink / raw)
  To: linux-kernel

Hi list.

As I said yesterday, the 2.6.10rc3 kernel warns compiling the aic7xxxx 
SCSI driver:

---
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c: In function 
`ahc_linux_pci_dev_probe':
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:229: warning: large integer 
implicitly truncated to unsigned type
---

[aic7xxx_osm_pci.c]
    mask_39bit = 0x7FFFFFFFFFULL;

mask_39bit type is dma_addr_t. However the length of dma_addr_t is 
defined in types.h.

[types.h]
    #ifdef CONFIG_HIGHMEM64G
    typedef u64 dma_addr_t;
    #else
    typedef u32 dma_addr_t;
    #endif
    typedef u64 dma64_addr_t;

I think the correct solution is to make the assignement only if 
CONFIG_HIGHMEM64G is defined:

[aic7xxx_osm_pci.c]
        mask_39bit = 0x7FFFFFFFFFULL;  //assignement
        if (sizeof(dma_addr_t) > 4 //CONFIG_HIGHMEM64G is defined
         && ahc_linux_get_memsize() > 0x80000000
         && pci_set_dma_mask(pdev, mask_39bit) == 0) {

            /* the correct position of the assignement IMHO */

            ahc->flags |= AHC_39BIT_ADDRESSING;
            ahc->platform_data->hw_dma_mask = mask_39bit;
        } else {
            if (pci_set_dma_mask(pdev, 0xFFFFFFFF)) {
                printk(KERN_WARNING "aic7xxx: No suitable DMA 
available.\n");
                        return (-ENODEV);
            }
            ahc->platform_data->hw_dma_mask = 0xFFFFFFFF;

Before I post a new patch, I wish to know your opinion.

Thanks,
MaF


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-07 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-06  0:23 aic7xxx driver large integer warning Miguel Angel Flores
2004-12-06 13:31 ` Alan Cox
2004-12-06 17:30   ` Miguel Angel Flores
2004-12-07 12:58     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox