aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche2022-02-18 11:51:04 -0800
committerMartin K. Petersen2022-02-22 21:11:06 -0500
commitaf0d3c13e468a5268e4248d8087880e425df1921 (patch)
treefba19b1bf901e138639a6a6cb6c21000f118c309
parent8d1537342ff20719b2dad3ad67f84f7a085546fd (diff)
scsi: mvumi: 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-37-bvanassche@acm.org Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> 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>
-rw-r--r--drivers/scsi/mvumi.c9
-rw-r--r--drivers/scsi/mvumi.h9
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 904de62c974c..05d3ce9b72db 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -1302,7 +1302,7 @@ static void mvumi_complete_cmd(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
{
struct scsi_cmnd *scmd = cmd->scmd;
- cmd->scmd->SCp.ptr = NULL;
+ mvumi_priv(cmd->scmd)->cmd_priv = NULL;
scmd->result = ob_frame->req_status;
switch (ob_frame->req_status) {
@@ -2097,7 +2097,7 @@ static int mvumi_queue_command(struct Scsi_Host *shost,
goto out_return_cmd;
cmd->scmd = scmd;
- scmd->SCp.ptr = (char *) cmd;
+ mvumi_priv(scmd)->cmd_priv = cmd;
mhba->instancet->fire_cmd(mhba, cmd);
spin_unlock_irqrestore(shost->host_lock, irq_flags);
return 0;
@@ -2111,7 +2111,7 @@ out_return_cmd:
static enum blk_eh_timer_return mvumi_timed_out(struct scsi_cmnd *scmd)
{
- struct mvumi_cmd *cmd = (struct mvumi_cmd *) scmd->SCp.ptr;
+ struct mvumi_cmd *cmd = mvumi_priv(scmd)->cmd_priv;
struct Scsi_Host *host = scmd->device->host;
struct mvumi_hba *mhba = shost_priv(host);
unsigned long flags;
@@ -2128,7 +2128,7 @@ static enum blk_eh_timer_return mvumi_timed_out(struct scsi_cmnd *scmd)
atomic_dec(&mhba->fw_outstanding);
scmd->result = (DID_ABORT << 16);
- scmd->SCp.ptr = NULL;
+ mvumi_priv(scmd)->cmd_priv = NULL;
if (scsi_bufflen(scmd)) {
dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd),
scsi_sg_count(scmd),
@@ -2179,6 +2179,7 @@ static struct scsi_host_template mvumi_template = {
.bios_param = mvumi_bios_param,
.dma_boundary = PAGE_SIZE - 1,
.this_id = -1,
+ .cmd_size = sizeof(struct mvumi_cmd_priv),
};
static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba)
diff --git a/drivers/scsi/mvumi.h b/drivers/scsi/mvumi.h
index 60d5691fc4ab..a88c58787b68 100644
--- a/drivers/scsi/mvumi.h
+++ b/drivers/scsi/mvumi.h
@@ -254,6 +254,15 @@ struct mvumi_cmd {
unsigned char cmd_status;
};
+struct mvumi_cmd_priv {
+ struct mvumi_cmd *cmd_priv;
+};
+
+static inline struct mvumi_cmd_priv *mvumi_priv(struct scsi_cmnd *cmd)
+{
+ return scsi_cmd_priv(cmd);
+}
+
/*
* the function type of the in bound frame
*/