scsi: mpt3sas: Fix _ctl_set_task_mid() TaskMID check
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 7 Mar 2022 23:48:50 +0000 (08:48 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 02:30:04 +0000 (22:30 -0400)
commitdceaef94a4753d4d49d493a6cd4a81168e384d6f
tree2634f1f1908ea8dc7cd599e1f5c5b12d268bec34
parentad14649fc5ab216e0abb6b38115898238a0991f5
scsi: mpt3sas: Fix _ctl_set_task_mid() TaskMID check

The TaskMID field of struct Mpi2SCSITaskManagementRequest_t is a 16-bit
little endian value. Fix the search loop in _ctl_set_task_mid() to add a
cpu_to_le16() conversion before checking the value of TaskMID to avoid
sparse warnings. While at it, simplify the search loop code to remove an
unnecessarily complicated if condition.

Link: https://lore.kernel.org/r/20220307234854.148145-2-damien.lemoal@opensource.wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_ctl.c