Re: [PATCH 08/20] scsi: pm8001: Fix local variable declaration in pm80xx_pci_mem_copy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/02/2022 11:42, Damien Le Moal wrote:
Declare the local variable destination1 as a pointer to a __le32 value
rather than a u32. This suppresses the sparse warning:

warning: incorrect type in assignment (different base types)
     expected unsigned int [usertype]
     got restricted __le32 [usertype]

Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>

Reviewed-by: John Garry <john.garry@xxxxxxxxxx>

---
  drivers/scsi/pm8001/pm80xx_hwi.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index ec6b970e05a1..37ede7c79e85 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -71,14 +71,13 @@ static void pm80xx_pci_mem_copy(struct pm8001_hba_info  *pm8001_ha, u32 soffset,
  				u32 dw_count, u32 bus_base_number)
  {
  	u32 index, value, offset;
-	u32 *destination1;
-	destination1 = (u32 *)destination;
+	__le32 *destination1 = (__le32 *)destination;
for (index = 0; index < dw_count; index += 4, destination1++) {
  		offset = (soffset + index);
  		if (offset < (64 * 1024)) {
  			value = pm8001_cr32(pm8001_ha, bus_base_number, offset);
-			*destination1 =  cpu_to_le32(value);
+			*destination1 = cpu_to_le32(value);

I can't help but wonder if there is already something to do this, like memcpy_fromio()

  		}
  	}
  	return;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux