[libata qstor] minor update per LKML comments
Linux Kernel Mailing List <[email protected]> Thu, 24 Feb 2005 05:32:06 +0000
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1537.6.10, 2005/02/24 00:32:06-05:00, [email protected] [libata qstor] minor update per LKML comments * use __le{32,64} * use DMA_{32,64}BIT_MASK Also, add these to linux/libata-compat.h since they are not defined in 2.4.x. drivers/scsi/sata_qstor.c | 14 +++++++------- include/linux/libata-compat.h | 7 +++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff -Nru a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c --- a/drivers/scsi/sata_qstor.c 2005-03-04 12:02:35 -08:00 +++ b/drivers/scsi/sata_qstor.c 2005-03-04 12:02:35 -08:00 @@ -262,11 +262,11 @@ u32 len; addr = sg_dma_address(sg); - *(u64 *)prd = cpu_to_le64(addr); + *(__le64 *)prd = cpu_to_le64(addr); prd += sizeof(u64); len = sg_dma_len(sg); - *(u32 *)prd = cpu_to_le32(len); + *(__le32 *)prd = cpu_to_le32(len); prd += sizeof(u64); VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem, @@ -299,10 +299,10 @@ /* host control block (HCB) */ buf[ 0] = QS_HCB_HDR; buf[ 1] = hflags; - *(u32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE); - *(u32 *)(&buf[ 8]) = cpu_to_le32(qc->n_elem); + *(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE); + *(__le32 *)(&buf[ 8]) = cpu_to_le32(qc->n_elem); addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES; - *(u64 *)(&buf[16]) = cpu_to_le64(addr); + *(__le64 *)(&buf[16]) = cpu_to_le64(addr); /* device control block (DCB) */ buf[24] = QS_DCB_HDR; @@ -567,10 +567,10 @@ int rc, have_64bit_bus = (bus_info & QS_HPHY_64BIT); if (have_64bit_bus && - !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) { + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { /* do nothing */ } else { - rc = pci_set_dma_mask(pdev, 0xffffffffULL); + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (rc) { printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n", diff -Nru a/include/linux/libata-compat.h b/include/linux/libata-compat.h --- a/include/linux/libata-compat.h 2005-03-04 12:02:35 -08:00 +++ b/include/linux/libata-compat.h 2005-03-04 12:02:35 -08:00 @@ -1,9 +1,16 @@ #ifndef __LIBATA_COMPAT_H__ #define __LIBATA_COMPAT_H__ +#include <linux/types.h> #include <linux/delay.h> #include <linux/pci.h> #include <linux/slab.h> + +typedef u32 __le32; +typedef u64 __le64; + +#define DMA_64BIT_MASK 0xffffffffffffffffULL +#define DMA_32BIT_MASK 0x00000000ffffffffULL #define MODULE_VERSION(ver_str)