diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-02-18 20:51:00 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-02-23 03:11:05 +0100 |
commit | fb597392b1f49b4fe1a280471f00817daee1436c (patch) | |
tree | 132609fcdf9fcd33abc4f6aaf38b5cc04739562b /drivers/scsi/megaraid.c | |
parent | scsi: mac53c94: Move the SCSI pointer to private command data (diff) | |
download | linux-fb597392b1f49b4fe1a280471f00817daee1436c.tar.xz linux-fb597392b1f49b4fe1a280471f00817daee1436c.zip |
scsi: megaraid: Stop using the SCSI pointer
Set .cmd_size in the SCSI host template instead of using the SCSI pointer
from struct scsi_cmnd. This patch prepares for removal of the SCSI pointer
from struct scsi_cmnd.
Link: https://lore.kernel.org/r/20220218195117.25689-33-bvanassche@acm.org
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 2061e3fe9824..a5d8cee2d510 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1644,16 +1644,10 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) static void mega_rundoneq (adapter_t *adapter) { - struct scsi_cmnd *cmd; - struct list_head *pos; + struct megaraid_cmd_priv *cmd_priv; - list_for_each(pos, &adapter->completed_list) { - - struct scsi_pointer* spos = (struct scsi_pointer *)pos; - - cmd = list_entry(spos, struct scsi_cmnd, SCp); - scsi_done(cmd); - } + list_for_each_entry(cmd_priv, &adapter->completed_list, entry) + scsi_done(megaraid_to_scsi_cmd(cmd_priv)); INIT_LIST_HEAD(&adapter->completed_list); } @@ -4123,6 +4117,7 @@ static struct scsi_host_template megaraid_template = { .eh_bus_reset_handler = megaraid_reset, .eh_host_reset_handler = megaraid_reset, .no_write_same = 1, + .cmd_size = sizeof(struct megaraid_cmd_priv), }; static int |