Message ID | 20231023073021.21954-1-hare@suse.de |
---|---|
State | New |
Headers | show |
Series | megaraid: fixup debug message in megaraid_abort_and_reset() | expand |
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.
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 --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;
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(-)