scsi: pm8001: Fix le32 values handling in pm80xx_set_sas_protocol_timer_config()
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sun, 20 Feb 2022 03:17:47 +0000 (12:17 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Feb 2022 02:31:17 +0000 (21:31 -0500)
commitca374f5d92b8ae778f6a37dd3e7ed809bbf7a953
tree3a4c7c4cd4e3e420d14f2ff10374316ad92ab70e
parentbb225b12dbcc82d53d637d10b8d70b64494f8c16
scsi: pm8001: Fix le32 values handling in pm80xx_set_sas_protocol_timer_config()

All fields of the SASProtocolTimerConfig structure have the __le32 type.
As such, use cpu_to_le32() to initialize them. This change suppresses many
sparse warnings:

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

Note that the check to limit the value of the STP_IDLE_TMO field is removed
as this field is initialized using the fixed (and small) value defined by
the STP_IDLE_TIME macro.

The pm8001_dbg() calls printing the values of the SASProtocolTimerConfig
structure fileds are changed to use le32_to_cpu() to present the values in
human readable form.

Link: https://lore.kernel.org/r/20220220031810.738362-9-damien.lemoal@opensource.wdc.com
Fixes: a6cb3d012b98 ("[SCSI] pm80xx: thermal, sas controller config and error handling update")
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