Thread (39 messages) 39 messages, 5 authors, 2021-07-08

Re: [PATCH 10/21] ufs: Remove ufshcd_valid_tag()

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-07-05 18:08:38

On 7/4/21 11:46 PM, Avri Altman wrote:
quoted
scsi_add_host() allocates shost->can_queue tags. ufshcd_init() sets
shost->can_queue to hba->nutrs. In other words, we know that tag values
will be in the range [0, hba->nutrs). Hence remove the checks that
verify that blk_get_request() returns a tag in this range. This check
was introduced by commit 14497328b6a6 ("scsi: ufs: verify command tag
validity").

Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
quoted
 static int ufshcd_abort(struct scsi_cmnd *cmd)
 {
-       struct Scsi_Host *host;
-       struct ufs_hba *hba;
+       struct Scsi_Host *host = cmd->device->host;
+       struct ufs_hba *hba = shost_priv(host);
+       unsigned int tag = cmd->request->tag;
+       struct ufshcd_lrb *lrbp = &hba->lrb[tag];
        unsigned long flags;
-       unsigned int tag;
        int err = 0;
-       struct ufshcd_lrb *lrbp;
        u32 reg;

-       host = cmd->device->host;
-       hba = shost_priv(host);
-       tag = cmd->request->tag;
-       lrbp = &hba->lrb[tag];
lrbp is used below ?
if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) ...
Hi Avri,

The lrbp assignment is preserved but it has been moved up to the
declaration block.

Bart.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help