]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: pm8001: Fix use of struct set_phy_profile_req fields
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sun, 20 Feb 2022 03:17:51 +0000 (12:17 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Feb 2022 02:31:18 +0000 (21:31 -0500)
In mpi_set_phy_profile_req() and pm8001_set_phy_profile_single(), use
cpu_to_le32() to initialize the ppc_phyid field of struct
set_phy_profile_req. Furthermore, fix the definition of the reserved field
of this structure to be an array of __le32, to match the use of
cpu_to_le32() when assigning values. These changes remove several sparse
type warnings.

Link: https://lore.kernel.org/r/20220220031810.738362-13-damien.lemoal@opensource.wdc.com
Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm80xx_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.h

index 1f3b01c70f248a6bc1a32b3ca637eff45fd8fefb..60c305f987b5b2d2c2c9936fc06a10bb7f88e5ca 100644 (file)
@@ -4970,12 +4970,13 @@ static void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
                pm8001_dbg(pm8001_ha, FAIL, "Invalid tag\n");
        circularQ = &pm8001_ha->inbnd_q_tbl[0];
        payload.tag = cpu_to_le32(tag);
-       payload.ppc_phyid = (((operation & 0xF) << 8) | (phyid  & 0xFF));
+       payload.ppc_phyid =
+               cpu_to_le32(((operation & 0xF) << 8) | (phyid  & 0xFF));
        pm8001_dbg(pm8001_ha, INIT,
                   " phy profile command for phy %x ,length is %d\n",
-                  payload.ppc_phyid, length);
+                  le32_to_cpu(payload.ppc_phyid), length);
        for (i = length; i < (length + PHY_DWORD_LENGTH - 1); i++) {
-               payload.reserved[j] =  cpu_to_le32(*((u32 *)buf + i));
+               payload.reserved[j] = cpu_to_le32(*((u32 *)buf + i));
                j++;
        }
        rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload,
@@ -5015,8 +5016,9 @@ void pm8001_set_phy_profile_single(struct pm8001_hba_info *pm8001_ha,
        opc = OPC_INB_SET_PHY_PROFILE;
 
        payload.tag = cpu_to_le32(tag);
-       payload.ppc_phyid = (((SAS_PHY_ANALOG_SETTINGS_PAGE & 0xF) << 8)
-                               | (phy & 0xFF));
+       payload.ppc_phyid =
+               cpu_to_le32(((SAS_PHY_ANALOG_SETTINGS_PAGE & 0xF) << 8)
+                           | (phy & 0xFF));
 
        for (i = 0; i < length; i++)
                payload.reserved[i] = cpu_to_le32(*(buf + i));
index c41ed039c92ac9087c4d8e90e0e304406d50f71a..d66b49323d49ec76e7553752749980a0ab506422 100644 (file)
@@ -972,7 +972,7 @@ struct dek_mgmt_req {
 struct set_phy_profile_req {
        __le32  tag;
        __le32  ppc_phyid;
-       u32     reserved[29];
+       __le32  reserved[29];
 } __attribute__((packed, aligned(4)));
 
 /**