diff mbox series

[v2,1/4] scsi: ufs: Remove request tag range checks

Message ID 20230921192335.676924-2-bvanassche@acm.org (mailing list archive)
State Accepted
Headers show
Series UFS core patches | expand

Commit Message

Bart Van Assche Sept. 21, 2023, 7:22 p.m. UTC
The block layer core guarantees that tag numbers are in the expected
range. Hence remove the statements that check this. This patch suppresses
Coverity warnings about left shifts with a negative right hand operand.
The following commit originally introduced request tag range checks:
14497328b6a6 ("scsi: ufs: verify command tag validity").

Cc: daejun7.park@samsung.com
Cc: John Garry <john.g.garry@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

John Garry Sept. 22, 2023, 6:31 a.m. UTC | #1
On 21/09/2023 20:22, Bart Van Assche wrote:
> The block layer core guarantees that tag numbers are in the expected
> range. Hence remove the statements that check this. This patch suppresses
> Coverity warnings about left shifts with a negative right hand operand.
> The following commit originally introduced request tag range checks:
> 14497328b6a6 ("scsi: ufs: verify command tag validity").
> 
> Cc:daejun7.park@samsung.com
> Cc: John Garry<john.g.garry@oracle.com>
> Signed-off-by: Bart Van Assche<bvanassche@acm.org>

Feel free to add:
Reviewed-by: John Garry <john.g.garry@oracle.com>
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index dc1285351336..f48a65fa3bf7 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2822,8 +2822,6 @@  static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
 	int err = 0;
 	struct ufs_hw_queue *hwq = NULL;
 
-	WARN_ONCE(tag < 0 || tag >= hba->nutrs, "Invalid tag %d\n", tag);
-
 	switch (hba->ufshcd_state) {
 	case UFSHCD_STATE_OPERATIONAL:
 		break;
@@ -6923,8 +6921,6 @@  static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
 	spin_lock_irqsave(host->host_lock, flags);
 
 	task_tag = req->tag;
-	WARN_ONCE(task_tag < 0 || task_tag >= hba->nutmrs, "Invalid tag %d\n",
-		  task_tag);
 	hba->tmf_rqs[req->tag] = req;
 	treq->upiu_req.req_header.task_tag = task_tag;
 
@@ -7498,8 +7494,6 @@  static int ufshcd_abort(struct scsi_cmnd *cmd)
 	bool outstanding;
 	u32 reg;
 
-	WARN_ONCE(tag < 0, "Invalid tag %d\n", tag);
-
 	ufshcd_hold(hba);
 
 	if (!is_mcq_enabled(hba)) {