diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-02-18 11:51:15 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-02-22 21:11:07 -0500 |
commit | dbb2da557a6a87c88bbb4b1fef037091b57f701b (patch) | |
tree | ed44fc6aaccade148bf6277803ce98454508a91d /drivers/scsi/mvme147.c | |
parent | 70d1b920af62a7d065aa7a0d031dd1af44e8b31b (diff) | |
download | lwn-dbb2da557a6a87c88bbb4b1fef037091b57f701b.tar.gz lwn-dbb2da557a6a87c88bbb4b1fef037091b57f701b.zip |
scsi: wd33c93: Move the SCSI pointer to private command data
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-48-bvanassche@acm.org
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/mvme147.c')
-rw-r--r-- | drivers/scsi/mvme147.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c index 0893d4c3a916..472fa043094f 100644 --- a/drivers/scsi/mvme147.c +++ b/drivers/scsi/mvme147.c @@ -33,10 +33,11 @@ static irqreturn_t mvme147_intr(int irq, void *data) static int dma_setup(struct scsi_cmnd *cmd, int dir_in) { + struct scsi_pointer *scsi_pointer = WD33C93_scsi_pointer(cmd); struct Scsi_Host *instance = cmd->device->host; struct WD33C93_hostdata *hdata = shost_priv(instance); unsigned char flags = 0x01; - unsigned long addr = virt_to_bus(cmd->SCp.ptr); + unsigned long addr = virt_to_bus(scsi_pointer->ptr); /* setup dma direction */ if (!dir_in) @@ -47,14 +48,14 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) if (dir_in) { /* invalidate any cache */ - cache_clear(addr, cmd->SCp.this_residual); + cache_clear(addr, scsi_pointer->this_residual); } else { /* push any dirty cache */ - cache_push(addr, cmd->SCp.this_residual); + cache_push(addr, scsi_pointer->this_residual); } /* start DMA */ - m147_pcc->dma_bcr = cmd->SCp.this_residual | (1 << 24); + m147_pcc->dma_bcr = scsi_pointer->this_residual | (1 << 24); m147_pcc->dma_dadr = addr; m147_pcc->dma_cntrl = flags; @@ -81,6 +82,7 @@ static struct scsi_host_template mvme147_host_template = { .this_id = 7, .sg_tablesize = SG_ALL, .cmd_per_lun = CMD_PER_LUN, + .cmd_size = sizeof(struct scsi_pointer), }; static struct Scsi_Host *mvme147_shost; |