Message ID | 20210513223757.3938-6-bvanassche@acm.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Rename scsi_get_lba() into scsi_get_sector() | expand |
On 2021/05/14 7:38, Bart Van Assche wrote: > Use scsi_get_sector() instead of scsi_get_lba() since the name of the > latter is confusing. This patch does not change any functionality. > > Cc: James Smart <james.smart@broadcom.com> > Signed-off-by: Bart Van Assche <bvanassche@acm.org> > --- > drivers/scsi/lpfc/lpfc_scsi.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c > index eefbb9b22798..8c6b25807f12 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_sector(cmd), Why the cast ? scsi_get_sector() returns a 64bits sector_t. > 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_sector(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_sector(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_sector(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_sector(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_sector(cmd); > failing_sector += bghm; > > /* Descriptor Information */ >
On 5/13/21 7:00 PM, Damien Le Moal wrote: > On 2021/05/14 7:38, Bart Van Assche wrote: >> diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c >> index eefbb9b22798..8c6b25807f12 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_sector(cmd), > > Why the cast ? scsi_get_sector() returns a 64bits sector_t. Right, the cast can be left out. Commit 72deb455b5ec ("block: remove CONFIG_LBDAF") changed sector_t from sometimes 32-bit / sometimes 64-bit into always 64-bit. Bart.
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index eefbb9b22798..8c6b25807f12 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_sector(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_sector(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_sector(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_sector(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_sector(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_sector(cmd); failing_sector += bghm; /* Descriptor Information */
Use scsi_get_sector() instead of scsi_get_lba() since the name of the latter is confusing. This patch does not change any functionality. Cc: James Smart <james.smart@broadcom.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/scsi/lpfc/lpfc_scsi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)