diff mbox series

megaraid: fixup debug message in megaraid_abort_and_reset()

Message ID 20231023073021.21954-1-hare@suse.de (mailing list archive)
State Accepted
Headers show
Series megaraid: fixup debug message in megaraid_abort_and_reset() | expand

Commit Message

Hannes Reinecke Oct. 23, 2023, 7:30 a.m. UTC
Found by Smatch.

Fixes: 5bcd3bfbda02 ("scsi: megaraid: Pass in NULL scb for host reset")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/megaraid.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Christoph Hellwig Oct. 24, 2023, 6:25 a.m. UTC | #1
On Mon, Oct 23, 2023 at 09:30:21AM +0200, Hannes Reinecke wrote:
> @@ -1925,10 +1925,12 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor)
>  	struct list_head	*pos, *next;
>  	scb_t			*scb;
>  
> -	dev_warn(&adapter->dev->dev, "%s cmd=%x <c=%d t=%d l=%d>\n",
> -	     (aor == SCB_ABORT)? "ABORTING":"RESET",
> -	     cmd->cmnd[0], cmd->device->channel,
> -	     cmd->device->id, (u32)cmd->device->lun);
> +	if (aor == SCB_ABORT)
> +		dev_warn(&adapter->dev->dev, "ABORTING cmd=%x <c=%d t=%d l=%d>\n",

Please avoid the overly long line here.

Otherwise looks good.
Martin K. Petersen Oct. 25, 2023, 2:41 a.m. UTC | #2
Hannes,

> Found by Smatch.

Applied to 6.7/scsi-staging, thanks!
Martin K. Petersen Oct. 30, 2023, 3:34 p.m. UTC | #3
On Mon, 23 Oct 2023 09:30:21 +0200, Hannes Reinecke wrote:

> Found by Smatch.
> 
> 

Applied to 6.7/scsi-queue, thanks!

[1/1] megaraid: fixup debug message in megaraid_abort_and_reset()
      https://git.kernel.org/mkp/scsi/c/f2d79aa16aee
diff mbox series

Patch

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 329c3da88416..d59964ceef47 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -1925,10 +1925,12 @@  megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor)
 	struct list_head	*pos, *next;
 	scb_t			*scb;
 
-	dev_warn(&adapter->dev->dev, "%s cmd=%x <c=%d t=%d l=%d>\n",
-	     (aor == SCB_ABORT)? "ABORTING":"RESET",
-	     cmd->cmnd[0], cmd->device->channel,
-	     cmd->device->id, (u32)cmd->device->lun);
+	if (aor == SCB_ABORT)
+		dev_warn(&adapter->dev->dev, "ABORTING cmd=%x <c=%d t=%d l=%d>\n",
+			 cmd->cmnd[0], cmd->device->channel,
+			 cmd->device->id, (u32)cmd->device->lun);
+	else
+		dev_warn(&adapter->dev->dev, "RESETTING\n");
 
 	if(list_empty(&adapter->pending_list))
 		return FAILED;