Commit e5039a92 authored by Damien Le Moal's avatar Damien Le Moal Committed by Martin K. Petersen
Browse files

scsi: pm8001: Fix use of struct set_phy_profile_req fields

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: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fd6d0e37
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -4970,10 +4970,11 @@ 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));
		j++;
@@ -5015,7 +5016,8 @@ 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)
	payload.ppc_phyid =
		cpu_to_le32(((SAS_PHY_ANALOG_SETTINGS_PAGE & 0xF) << 8)
			    | (phy & 0xFF));

	for (i = 0; i < length; i++)
+1 −1
Original line number Diff line number Diff line
@@ -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)));

/**