aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aachba.c
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2005-04-27 09:05:51 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-05-20 13:53:38 -0400
commit56b5871223f66d4a34e6e1069f241077e9f0a154 (patch)
tree8a259fd9d1544dd6d8b3a607b8589ffd2f935693 /drivers/scsi/aacraid/aachba.c
parent1c2fb3f38e250dd3b88612435869acf92b4f51e2 (diff)
[SCSI] aacraid: remove sparse warnings
This patch addresses the sparse -Wbitwise warnings that Christoph wanted me to eliminate. This mostly consisted of making data structure elements of hardware associated structures the __le* equivalent. Although there were a couple places where there was mixing of cpu and le variable math. These changes have been tested on both an x86 and ppc machine running bonnie++. The usage of the LE32_ALL_ONES macro has been eliminated. Signed-off-by: Mark Haverkamp <markh@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r--drivers/scsi/aacraid/aachba.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 66d48e0c4cd7..9946e305055b 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1893,7 +1893,9 @@ static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* psg)
1893 } 1893 }
1894 /* hba wants the size to be exact */ 1894 /* hba wants the size to be exact */
1895 if(byte_count > scsicmd->request_bufflen){ 1895 if(byte_count > scsicmd->request_bufflen){
1896 psg->sg[i-1].count -= (byte_count - scsicmd->request_bufflen); 1896 u32 temp = le32_to_cpu(psg->sg[i-1].count) -
1897 (byte_count - scsicmd->request_bufflen);
1898 psg->sg[i-1].count = cpu_to_le32(temp);
1897 byte_count = scsicmd->request_bufflen; 1899 byte_count = scsicmd->request_bufflen;
1898 } 1900 }
1899 /* Check for command underflow */ 1901 /* Check for command underflow */
@@ -1922,7 +1924,7 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1922{ 1924{
1923 struct aac_dev *dev; 1925 struct aac_dev *dev;
1924 unsigned long byte_count = 0; 1926 unsigned long byte_count = 0;
1925 u64 le_addr; 1927 u64 addr;
1926 1928
1927 dev = (struct aac_dev *)scsicmd->device->host->hostdata; 1929 dev = (struct aac_dev *)scsicmd->device->host->hostdata;
1928 // Get rid of old data 1930 // Get rid of old data
@@ -1943,16 +1945,18 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1943 byte_count = 0; 1945 byte_count = 0;
1944 1946
1945 for (i = 0; i < sg_count; i++) { 1947 for (i = 0; i < sg_count; i++) {
1946 le_addr = cpu_to_le64(sg_dma_address(sg)); 1948 addr = sg_dma_address(sg);
1947 psg->sg[i].addr[1] = (u32)(le_addr>>32); 1949 psg->sg[i].addr[0] = cpu_to_le32(addr & 0xffffffff);
1948 psg->sg[i].addr[0] = (u32)(le_addr & 0xffffffff); 1950 psg->sg[i].addr[1] = cpu_to_le32(addr>>32);
1949 psg->sg[i].count = cpu_to_le32(sg_dma_len(sg)); 1951 psg->sg[i].count = cpu_to_le32(sg_dma_len(sg));
1950 byte_count += sg_dma_len(sg); 1952 byte_count += sg_dma_len(sg);
1951 sg++; 1953 sg++;
1952 } 1954 }
1953 /* hba wants the size to be exact */ 1955 /* hba wants the size to be exact */
1954 if(byte_count > scsicmd->request_bufflen){ 1956 if(byte_count > scsicmd->request_bufflen){
1955 psg->sg[i-1].count -= (byte_count - scsicmd->request_bufflen); 1957 u32 temp = le32_to_cpu(psg->sg[i-1].count) -
1958 (byte_count - scsicmd->request_bufflen);
1959 psg->sg[i-1].count = cpu_to_le32(temp);
1956 byte_count = scsicmd->request_bufflen; 1960 byte_count = scsicmd->request_bufflen;
1957 } 1961 }
1958 /* Check for command underflow */ 1962 /* Check for command underflow */
@@ -1962,15 +1966,14 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1962 } 1966 }
1963 } 1967 }
1964 else if(scsicmd->request_bufflen) { 1968 else if(scsicmd->request_bufflen) {
1965 dma_addr_t addr; 1969 u64 addr;
1966 addr = pci_map_single(dev->pdev, 1970 addr = pci_map_single(dev->pdev,
1967 scsicmd->request_buffer, 1971 scsicmd->request_buffer,
1968 scsicmd->request_bufflen, 1972 scsicmd->request_bufflen,
1969 scsicmd->sc_data_direction); 1973 scsicmd->sc_data_direction);
1970 psg->count = cpu_to_le32(1); 1974 psg->count = cpu_to_le32(1);
1971 le_addr = cpu_to_le64(addr); 1975 psg->sg[0].addr[0] = cpu_to_le32(addr & 0xffffffff);
1972 psg->sg[0].addr[1] = (u32)(le_addr>>32); 1976 psg->sg[0].addr[1] = cpu_to_le32(addr >> 32);
1973 psg->sg[0].addr[0] = (u32)(le_addr & 0xffffffff);
1974 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen); 1977 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);
1975 scsicmd->SCp.dma_handle = addr; 1978 scsicmd->SCp.dma_handle = addr;
1976 byte_count = scsicmd->request_bufflen; 1979 byte_count = scsicmd->request_bufflen;