diff mbox series

[10/20] scsi: pm8001: fix payload initialization in pm80xx_set_thermal_config()

Message ID 20220210114218.632725-11-damien.lemoal@opensource.wdc.com
State Superseded
Headers show
Series libsas and pm8001 fixes | expand

Commit Message

Damien Le Moal Feb. 10, 2022, 11:42 a.m. UTC
The fields of the set_ctrl_cfg_req structure have the __le32 type, so
use cpu_to_le32() to assign them. This removes the sparse warnings:

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

Fixes: 842784e0d15b ("pm80xx: Update For Thermal Page Code")
Fixes: f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

John Garry Feb. 10, 2022, 2:43 p.m. UTC | #1
On 10/02/2022 11:42, Damien Le Moal wrote:
> The fields of the set_ctrl_cfg_req structure have the __le32 type, so
> use cpu_to_le32() to assign them. This removes the sparse warnings:
> 
> warning: incorrect type in assignment (different base types)
>      expected restricted __le32
>      got unsigned int
> 
> Fixes: 842784e0d15b ("pm80xx: Update For Thermal Page Code")
> Fixes: f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files")
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


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


> ---
>   drivers/scsi/pm8001/pm80xx_hwi.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 37ede7c79e85..9c7383fb4bdc 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -1202,9 +1202,11 @@ pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
>   	else
>   		page_code = THERMAL_PAGE_CODE_8H;
>   
> -	payload.cfg_pg[0] = (THERMAL_LOG_ENABLE << 9) |
> -				(THERMAL_ENABLE << 8) | page_code;
> -	payload.cfg_pg[1] = (LTEMPHIL << 24) | (RTEMPHIL << 8);
> +	payload.cfg_pg[0] =
> +		cpu_to_le32((THERMAL_LOG_ENABLE << 9) |
> +			    (THERMAL_ENABLE << 8) | page_code);
> +	payload.cfg_pg[1] =
> +		cpu_to_le32((LTEMPHIL << 24) | (RTEMPHIL << 8));
>   
>   	pm8001_dbg(pm8001_ha, DEV,
>   		   "Setting up thermal config. cfg_pg 0 0x%x cfg_pg 1 0x%x\n",
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 37ede7c79e85..9c7383fb4bdc 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -1202,9 +1202,11 @@  pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
 	else
 		page_code = THERMAL_PAGE_CODE_8H;
 
-	payload.cfg_pg[0] = (THERMAL_LOG_ENABLE << 9) |
-				(THERMAL_ENABLE << 8) | page_code;
-	payload.cfg_pg[1] = (LTEMPHIL << 24) | (RTEMPHIL << 8);
+	payload.cfg_pg[0] =
+		cpu_to_le32((THERMAL_LOG_ENABLE << 9) |
+			    (THERMAL_ENABLE << 8) | page_code);
+	payload.cfg_pg[1] =
+		cpu_to_le32((LTEMPHIL << 24) | (RTEMPHIL << 8));
 
 	pm8001_dbg(pm8001_ha, DEV,
 		   "Setting up thermal config. cfg_pg 0 0x%x cfg_pg 1 0x%x\n",