Commit 7ab4d244 authored by Damien Le Moal's avatar Damien Le Moal Committed by Martin K. Petersen

scsi: mpt3sas: Fix ioc->base_readl() use

The functions _base_readl_aero() and _base_readl() used for an adapter
base_readl() method are implemented using a regular readl() call which
internally performs a conversion to CPU endianness (le32_to_cpu()) of
the values read. The users of the ioc base_readl() method should thus
not convert again the values read using le16_to_cpu().
Fixing this removes sparse warnings.

Link: https://lore.kernel.org/r/20220307234854.148145-4-damien.lemoal@opensource.wdc.comSigned-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b4efbec4
...@@ -6912,16 +6912,16 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, ...@@ -6912,16 +6912,16 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes,
} }
/* read the first two 16-bits, it gives the total length of the reply */ /* read the first two 16-bits, it gives the total length of the reply */
reply[0] = le16_to_cpu(ioc->base_readl(&ioc->chip->Doorbell) reply[0] = ioc->base_readl(&ioc->chip->Doorbell)
& MPI2_DOORBELL_DATA_MASK); & MPI2_DOORBELL_DATA_MASK;
writel(0, &ioc->chip->HostInterruptStatus); writel(0, &ioc->chip->HostInterruptStatus);
if ((_base_wait_for_doorbell_int(ioc, 5))) { if ((_base_wait_for_doorbell_int(ioc, 5))) {
ioc_err(ioc, "doorbell handshake int failed (line=%d)\n", ioc_err(ioc, "doorbell handshake int failed (line=%d)\n",
__LINE__); __LINE__);
return -EFAULT; return -EFAULT;
} }
reply[1] = le16_to_cpu(ioc->base_readl(&ioc->chip->Doorbell) reply[1] = ioc->base_readl(&ioc->chip->Doorbell)
& MPI2_DOORBELL_DATA_MASK); & MPI2_DOORBELL_DATA_MASK;
writel(0, &ioc->chip->HostInterruptStatus); writel(0, &ioc->chip->HostInterruptStatus);
for (i = 2; i < default_reply->MsgLength * 2; i++) { for (i = 2; i < default_reply->MsgLength * 2; i++) {
...@@ -6933,9 +6933,8 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, ...@@ -6933,9 +6933,8 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes,
if (i >= reply_bytes/2) /* overflow case */ if (i >= reply_bytes/2) /* overflow case */
ioc->base_readl(&ioc->chip->Doorbell); ioc->base_readl(&ioc->chip->Doorbell);
else else
reply[i] = le16_to_cpu( reply[i] = ioc->base_readl(&ioc->chip->Doorbell)
ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK;
& MPI2_DOORBELL_DATA_MASK);
writel(0, &ioc->chip->HostInterruptStatus); writel(0, &ioc->chip->HostInterruptStatus);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment