]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/block/mtip32xx/mtip32xx.c
mtip32xx: Fix to make lba address correct in big-endian systems
[~shefty/rdma-dev.git] / drivers / block / mtip32xx / mtip32xx.c
index dfb7196bbde9551ff93701bc4e312cbd63d58dd3..df46b5a3f56fdc59507911c60b918d2609c24b8a 100644 (file)
@@ -2465,8 +2465,12 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start,
        fis->opts        = 1 << 7;
        fis->command     =
                (dir == READ ? ATA_CMD_FPDMA_READ : ATA_CMD_FPDMA_WRITE);
-       *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF);
-       *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF);
+       fis->lba_low     = start & 0xFF;
+       fis->lba_mid     = (start >> 8) & 0xFF;
+       fis->lba_hi      = (start >> 16) & 0xFF;
+       fis->lba_low_ex  = (start >> 24) & 0xFF;
+       fis->lba_mid_ex  = (start >> 32) & 0xFF;
+       fis->lba_hi_ex   = (start >> 40) & 0xFF;
        fis->device      = 1 << 6;
        fis->features    = nsect & 0xFF;
        fis->features_ex = (nsect >> 8) & 0xFF;