scsi: mpt3sas: Fix writel() use
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 7 Mar 2022 23:48:51 +0000 (08:48 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 02:30:04 +0000 (22:30 -0400)
writel() internally executes cpu_to_le32() to convert the value being
written to little endian. The caller should thus not use this conversion
function for the value passed to writel(). Remove the cpu_to_le32() calls
in _base_put_smid_scsi_io_atomic(), _base_put_smid_fast_path_atomic(),
_base_put_smid_hi_priority_atomic() _base_put_smid_default_atomic() and
_base_handshake_req_reply_wait().

Link: https://lore.kernel.org/r/20220307234854.148145-3-damien.lemoal@opensource.wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c

index 538d2c0cd971303865eeace130c3eb5d95af4168..d7b23eb9b630cf0e4d303a5cb38d90a40d40afc5 100644 (file)
@@ -4312,7 +4312,7 @@ _base_put_smid_scsi_io_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
        descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid);
        descriptor.SMID = cpu_to_le16(smid);
 
-       writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
+       writel(*request, &ioc->chip->AtomicRequestDescriptorPost);
 }
 
 /**
@@ -4334,7 +4334,7 @@ _base_put_smid_fast_path_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
        descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid);
        descriptor.SMID = cpu_to_le16(smid);
 
-       writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
+       writel(*request, &ioc->chip->AtomicRequestDescriptorPost);
 }
 
 /**
@@ -4357,7 +4357,7 @@ _base_put_smid_hi_priority_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
        descriptor.MSIxIndex = msix_task;
        descriptor.SMID = cpu_to_le16(smid);
 
-       writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
+       writel(*request, &ioc->chip->AtomicRequestDescriptorPost);
 }
 
 /**
@@ -4378,7 +4378,7 @@ _base_put_smid_default_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid)
        descriptor.MSIxIndex = _base_set_and_get_msix_index(ioc, smid);
        descriptor.SMID = cpu_to_le16(smid);
 
-       writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
+       writel(*request, &ioc->chip->AtomicRequestDescriptorPost);
 }
 
 /**
@@ -6893,7 +6893,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes,
 
        /* send message 32-bits at a time */
        for (i = 0, failed = 0; i < request_bytes/4 && !failed; i++) {
-               writel(cpu_to_le32(request[i]), &ioc->chip->Doorbell);
+               writel(request[i], &ioc->chip->Doorbell);
                if ((_base_wait_for_doorbell_ack(ioc, 5)))
                        failed = 1;
        }