]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Cosmetics: mread returns data in CPU endian-ness,
authorMichael S. Tsirkin <mst@mellanox.co.il>
Thu, 17 May 2007 14:32:28 +0000 (17:32 +0300)
committerMichael S. Tsirkin <mst@mellanox.co.il>
Thu, 17 May 2007 14:32:28 +0000 (17:32 +0300)
so we must use __cpu_to_be32 and not __be32_to_cpu on it.

mflash.c

index 66ee0c3fb2a72219b49f1769bebfe577e5d65a82..5b171d1f6669b2e284b3d70270bb9a73bcf9dd7c 100644 (file)
--- a/mflash.c
+++ b/mflash.c
@@ -1413,7 +1413,7 @@ int ih3lx_st_spi_block_read    (mflash* mfl, u_int32_t blk_addr, u_int32_t blk_s
     for (offs = 0 ; offs < blk_size ; offs += 4) {
         u_int32_t word;
         MREAD4(CR_FLASH_DATA + offs, &word);
-        *((u_int32_t*)(data + offs))=  __be32_to_cpu(word);
+        *((u_int32_t*)(data + offs))= __cpu_to_be32(word);
     }
 
     return MFE_OK;
@@ -1788,7 +1788,7 @@ int cntx_st_spi_block_read_ex  (mflash* mfl, u_int32_t blk_addr, u_int32_t blk_s
     for (offs = 0 ; offs < blk_size ; offs += 4) {
         u_int32_t word;
         MREAD4(HCR_FLASH_DATA + offs, &word);
-        *((u_int32_t*)(data + offs))=  __be32_to_cpu(word);
+        *((u_int32_t*)(data + offs))=  __cpu_to_be32(word);
     }
 
     return MFE_OK;
@@ -1831,7 +1831,7 @@ int cntx_st_spi_block_read_old  (mflash* mfl, u_int32_t blk_addr, u_int32_t blk_
     for (offs = 0 ; offs < blk_size ; offs += 4) {
         u_int32_t word;
         MREAD4(HCR_FLASH_DATA + offs, &word);
-        *((u_int32_t*)(data + offs))=  __be32_to_cpu(word);
+        *((u_int32_t*)(data + offs))= __cpu_to_be32(word);
     }
 
     return MFE_OK;