mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
scsi: ufs: Remove a local variable from ufshcd_abort_all()
No functionality is changed. This patch prepares for unifying the MCQ and legacy code paths in this function. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-9-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
08108d3112
commit
e8b0234f84
@ -6387,9 +6387,14 @@ static bool ufshcd_is_pwr_mode_restore_needed(struct ufs_hba *hba)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ufshcd_abort_all - Abort all pending commands.
|
||||||
|
* @hba: Host bus adapter pointer.
|
||||||
|
*
|
||||||
|
* Return: true if and only if the host controller needs to be reset.
|
||||||
|
*/
|
||||||
static bool ufshcd_abort_all(struct ufs_hba *hba)
|
static bool ufshcd_abort_all(struct ufs_hba *hba)
|
||||||
{
|
{
|
||||||
bool needs_reset = false;
|
|
||||||
int tag, ret;
|
int tag, ret;
|
||||||
|
|
||||||
if (is_mcq_enabled(hba)) {
|
if (is_mcq_enabled(hba)) {
|
||||||
@ -6404,10 +6409,8 @@ static bool ufshcd_abort_all(struct ufs_hba *hba)
|
|||||||
dev_err(hba->dev, "Aborting tag %d / CDB %#02x %s\n", tag,
|
dev_err(hba->dev, "Aborting tag %d / CDB %#02x %s\n", tag,
|
||||||
hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0] : -1,
|
hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0] : -1,
|
||||||
ret ? "failed" : "succeeded");
|
ret ? "failed" : "succeeded");
|
||||||
if (ret) {
|
if (ret)
|
||||||
needs_reset = true;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Clear pending transfer requests */
|
/* Clear pending transfer requests */
|
||||||
@ -6416,25 +6419,22 @@ static bool ufshcd_abort_all(struct ufs_hba *hba)
|
|||||||
dev_err(hba->dev, "Aborting tag %d / CDB %#02x %s\n", tag,
|
dev_err(hba->dev, "Aborting tag %d / CDB %#02x %s\n", tag,
|
||||||
hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0] : -1,
|
hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0] : -1,
|
||||||
ret ? "failed" : "succeeded");
|
ret ? "failed" : "succeeded");
|
||||||
if (ret) {
|
if (ret)
|
||||||
needs_reset = true;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Clear pending task management requests */
|
/* Clear pending task management requests */
|
||||||
for_each_set_bit(tag, &hba->outstanding_tasks, hba->nutmrs) {
|
for_each_set_bit(tag, &hba->outstanding_tasks, hba->nutmrs) {
|
||||||
if (ufshcd_clear_tm_cmd(hba, tag)) {
|
ret = ufshcd_clear_tm_cmd(hba, tag);
|
||||||
needs_reset = true;
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* Complete the requests that are cleared by s/w */
|
/* Complete the requests that are cleared by s/w */
|
||||||
ufshcd_complete_requests(hba, false);
|
ufshcd_complete_requests(hba, false);
|
||||||
|
|
||||||
return needs_reset;
|
return ret != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user