From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
Jaegeuk Kim <jaegeuk@kernel.org>, Bean Huo <beanhuo@micron.com>,
Avri Altman <avri.altman@wdc.com>,
Asutosh Das <asutoshd@codeaurora.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Can Guo <cang@codeaurora.org>,
linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Nilesh Javali <njavali@marvell.com>
Subject: [PATCH v2 5/7] qla2xxx: Use scsi_get_pos() instead of scsi_get_lba()
Date: Wed, 12 May 2021 13:08:47 -0700 [thread overview]
Message-ID: <20210512200849.9002-6-bvanassche@acm.org> (raw)
In-Reply-To: <20210512200849.9002-1-bvanassche@acm.org>
Use scsi_get_pos() instead of scsi_get_lba() since the name of the latter
is confusing. Additionally, use lower_32_bits() instead of open-coding it.
This patch does not change any functionality.
Cc: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/lpfc/lpfc_scsi.c | 12 ++++++------
drivers/scsi/qla2xxx/qla_iocb.c | 9 +++------
drivers/scsi/qla2xxx/qla_isr.c | 8 ++++----
3 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index eefbb9b22798..ebce57c7b742 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -2963,7 +2963,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"9059 BLKGRD: Guard Tag error in cmd"
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
- (unsigned long long)scsi_get_lba(cmd),
+ (u64)scsi_get_pos(cmd),
blk_rq_sectors(cmd->request), bgstat, bghm);
}
@@ -2980,7 +2980,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"9060 BLKGRD: Ref Tag error in cmd"
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
- (unsigned long long)scsi_get_lba(cmd),
+ (u64)scsi_get_pos(cmd),
blk_rq_sectors(cmd->request), bgstat, bghm);
}
@@ -2997,7 +2997,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"9062 BLKGRD: App Tag error in cmd"
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
- (unsigned long long)scsi_get_lba(cmd),
+ (u64)scsi_get_pos(cmd),
blk_rq_sectors(cmd->request), bgstat, bghm);
}
@@ -3028,7 +3028,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
break;
}
- failing_sector = scsi_get_lba(cmd);
+ failing_sector = scsi_get_pos(cmd);
failing_sector += bghm;
/* Descriptor Information */
@@ -3041,7 +3041,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"9068 BLKGRD: Unknown error in cmd"
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
- (unsigned long long)scsi_get_lba(cmd),
+ (u64)scsi_get_pos(cmd),
blk_rq_sectors(cmd->request), bgstat, bghm);
/* Calcuate what type of error it was */
@@ -3174,7 +3174,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
break;
}
- failing_sector = scsi_get_lba(cmd);
+ failing_sector = scsi_get_pos(cmd);
failing_sector += bghm;
/* Descriptor Information */
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 38b5bdde2405..66e469890a7d 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -778,8 +778,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
* No check for ql2xenablehba_err_chk, as it would be an
* I/O error if hba tag generation is not done.
*/
- pkt->ref_tag = cpu_to_le32((uint32_t)
- (0xffffffff & scsi_get_lba(cmd)));
+ pkt->ref_tag = cpu_to_le32(lower_32_bits(scsi_get_pos(cmd)));
if (!qla2x00_hba_err_chk_enabled(sp))
break;
@@ -799,8 +798,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
pkt->app_tag_mask[0] = 0x0;
pkt->app_tag_mask[1] = 0x0;
- pkt->ref_tag = cpu_to_le32((uint32_t)
- (0xffffffff & scsi_get_lba(cmd)));
+ pkt->ref_tag = cpu_to_le32(lower_32_bits(scsi_get_pos(cmd)));
if (!qla2x00_hba_err_chk_enabled(sp))
break;
@@ -824,8 +822,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
* 16 bit app tag.
*/
case SCSI_PROT_DIF_TYPE1:
- pkt->ref_tag = cpu_to_le32((uint32_t)
- (0xffffffff & scsi_get_lba(cmd)));
+ pkt->ref_tag = cpu_to_le32(lower_32_bits(scsi_get_pos(cmd)));
pkt->app_tag = cpu_to_le16(0);
pkt->app_tag_mask[0] = 0x0;
pkt->app_tag_mask[1] = 0x0;
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 67229af4c142..d6b405d71f45 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2632,7 +2632,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
"DIF ERROR in cmd 0x%x lba 0x%llx act ref"
" tag=0x%x, exp ref_tag=0x%x, act app tag=0x%x, exp app"
" tag=0x%x, act guard=0x%x, exp guard=0x%x.\n",
- cmd->cmnd[0], (u64)scsi_get_lba(cmd), a_ref_tag, e_ref_tag,
+ cmd->cmnd[0], (u64)scsi_get_pos(cmd), a_ref_tag, e_ref_tag,
a_app_tag, e_app_tag, a_guard, e_guard);
/*
@@ -2644,10 +2644,10 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
(scsi_get_prot_type(cmd) != SCSI_PROT_DIF_TYPE3 ||
a_ref_tag == be32_to_cpu(T10_PI_REF_ESCAPE))) {
uint32_t blocks_done, resid;
- sector_t lba_s = scsi_get_lba(cmd);
+ sector_t pos = scsi_get_pos(cmd);
/* 2TB boundary case covered automatically with this */
- blocks_done = e_ref_tag - (uint32_t)lba_s + 1;
+ blocks_done = e_ref_tag - (uint32_t)pos + 1;
resid = scsi_bufflen(cmd) - (blocks_done *
cmd->device->sector_size);
@@ -2677,7 +2677,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
if (k != blocks_done) {
ql_log(ql_log_warn, vha, 0x302f,
"unexpected tag values tag:lba=%x:%llx)\n",
- e_ref_tag, (unsigned long long)lba_s);
+ e_ref_tag, (u64)pos);
return 1;
}
next prev parent reply other threads:[~2021-05-12 21:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 20:08 [PATCH v2 0/7] Rename scsi_get_lba() into scsi_get_pos() Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 1/7] Introduce scsi_get_pos() Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 2/7] iser: Use scsi_get_pos() instead of scsi_get_lba() Bart Van Assche
2021-05-12 20:46 ` Sagi Grimberg
2021-05-12 20:08 ` [PATCH v2 3/7] zfcp: " Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 4/7] isci: " Bart Van Assche
2021-05-12 20:08 ` Bart Van Assche [this message]
2021-05-12 20:08 ` [PATCH v2 6/7] ufs: Fix the tracing code Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 7/7] Remove scsi_get_lba() Bart Van Assche
2021-05-12 22:10 ` [PATCH v2 0/7] Rename scsi_get_lba() into scsi_get_pos() James Bottomley
2021-05-12 22:20 ` Bart Van Assche
2021-05-12 23:23 ` James Bottomley
2021-05-13 0:00 ` Bart Van Assche
2021-05-13 0:11 ` James Bottomley
2021-05-13 2:18 ` Damien Le Moal
2021-05-13 5:42 ` James Bottomley
2021-05-13 6:10 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210512200849.9002-6-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=cang@codeaurora.org \
--cc=jaegeuk@kernel.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox