summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshpb.c
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2021-08-10 06:55:09 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-08-12 04:25:42 +0200
commit12bc2f13f3813e95d7b13239291f9eb36dae83cb (patch)
tree792d48d3ee9c2f21867ca05f76d0a926dd898eba /drivers/scsi/ufs/ufshpb.c
parentscsi: storvsc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request (diff)
downloadlinux-12bc2f13f3813e95d7b13239291f9eb36dae83cb.tar.xz
linux-12bc2f13f3813e95d7b13239291f9eb36dae83cb.zip
scsi: ufs: ufshpb: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/ufs/ufshpb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index aafb55136c7e..9acce92a356b 100644
--- a/drivers/scsi/ufs/ufshpb.c
+++ b/drivers/scsi/ufs/ufshpb.c
@@ -70,13 +70,13 @@ static int ufshpb_is_valid_srgn(struct ufshpb_region *rgn,
static bool ufshpb_is_read_cmd(struct scsi_cmnd *cmd)
{
- return req_op(cmd->request) == REQ_OP_READ;
+ return req_op(scsi_cmd_to_rq(cmd)) == REQ_OP_READ;
}
static bool ufshpb_is_write_or_discard(struct scsi_cmnd *cmd)
{
- return op_is_write(req_op(cmd->request)) ||
- op_is_discard(req_op(cmd->request));
+ return op_is_write(req_op(scsi_cmd_to_rq(cmd))) ||
+ op_is_discard(req_op(scsi_cmd_to_rq(cmd)));
}
static bool ufshpb_is_supported_chunk(struct ufshpb_lu *hpb, int transfer_len)
@@ -526,9 +526,9 @@ static int ufshpb_execute_pre_req(struct ufshpb_lu *hpb, struct scsi_cmnd *cmd,
pre_req->hpb = hpb;
pre_req->wb.lpn = sectors_to_logical(cmd->device,
- blk_rq_pos(cmd->request));
+ blk_rq_pos(scsi_cmd_to_rq(cmd)));
pre_req->wb.len = sectors_to_logical(cmd->device,
- blk_rq_sectors(cmd->request));
+ blk_rq_sectors(scsi_cmd_to_rq(cmd)));
if (ufshpb_pre_req_add_bio_page(hpb, q, pre_req))
return -ENOMEM;
@@ -626,17 +626,17 @@ int ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
return -ENODEV;
}
- if (blk_rq_is_passthrough(cmd->request) ||
+ if (blk_rq_is_passthrough(scsi_cmd_to_rq(cmd)) ||
(!ufshpb_is_write_or_discard(cmd) &&
!ufshpb_is_read_cmd(cmd)))
return 0;
transfer_len = sectors_to_logical(cmd->device,
- blk_rq_sectors(cmd->request));
+ blk_rq_sectors(scsi_cmd_to_rq(cmd)));
if (unlikely(!transfer_len))
return 0;
- lpn = sectors_to_logical(cmd->device, blk_rq_pos(cmd->request));
+ lpn = sectors_to_logical(cmd->device, blk_rq_pos(scsi_cmd_to_rq(cmd)));
ufshpb_get_pos_from_lpn(hpb, lpn, &rgn_idx, &srgn_idx, &srgn_offset);
rgn = hpb->rgn_tbl + rgn_idx;
srgn = rgn->srgn_tbl + srgn_idx;