From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
MPT-FusionLinux.pdl@broadcom.com
Subject: [PATCH v3 2/5] scsi: mpt3sas: Fix writel() use
Date: Tue, 8 Mar 2022 08:48:51 +0900 [thread overview]
Message-ID: <20220307234854.148145-3-damien.lemoal@opensource.wdc.com> (raw)
In-Reply-To: <20220307234854.148145-1-damien.lemoal@opensource.wdc.com>
writel() internally execute cpu_to_le32() to convert the vale being
wrritten 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() amd _base_handshake_req_reply_wait().
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 511726f92d9a..6ebdfedd84f5 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4323,7 +4323,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);
}
/**
@@ -4345,7 +4345,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);
}
/**
@@ -4368,7 +4368,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);
}
/**
@@ -4389,7 +4389,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);
}
/**
@@ -6906,7 +6906,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;
}
--
2.35.1
next prev parent reply other threads:[~2022-03-07 23:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 23:48 [PATCH v3 0/5] Fix mpt3sas driver sparse warnings Damien Le Moal
2022-03-07 23:48 ` [PATCH v3 1/5] scsi: mpt3sas: fix _ctl_set_task_mid() TaskMID check Damien Le Moal
2022-03-07 23:48 ` Damien Le Moal [this message]
2022-03-07 23:48 ` [PATCH v3 3/5] scsi: mpt3sas: fix ioc->base_readl() use Damien Le Moal
2022-03-07 23:48 ` [PATCH v3 4/5] scsi: mpt3sas: fix event callback log_code value handling Damien Le Moal
2022-03-07 23:48 ` [PATCH v3 5/5] scsi: mpt3sas: fix adapter replyPostRegisterIndex declaration Damien Le Moal
2022-03-09 3:56 ` [PATCH v3 0/5] Fix mpt3sas driver sparse warnings Martin K. Petersen
2022-03-09 6:35 ` Sreekanth Reddy
2022-08-02 20:27 ` matoro
2022-08-02 23:36 ` Damien Le Moal
2022-08-11 19:05 ` matoro
2022-08-11 19:17 ` Damien Le Moal
2022-08-22 17:51 ` matoro
2022-08-22 17:53 ` Damien Le Moal
2022-09-15 15:55 ` matoro
2022-09-16 8:39 ` Damien Le Moal
2022-09-16 13:04 ` Damien Le Moal
2022-04-26 4:25 ` Damien Le Moal
2022-04-26 10:37 ` Martin K. Petersen
2022-04-26 10:44 ` Damien Le Moal
2022-05-03 0:51 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220307234854.148145-3-damien.lemoal@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.