Message ID | YEsbyEf3/+AunY34@mwanda (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | scsi: sg: Fix a warning message | expand |
On 2021-03-12 2:44 a.m., Dan Carpenter wrote: > The WARN_ONCE() macro takes a condition and a warning message as > parameters. This code accidentally left out the condition so it > doesn't print a warning (just a stack trace). > > Fixes: ddfb8cbdf699 ("scsi: sg: Rework scatter-gather handling") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> This one wasn't addressed yesterday, thanks. > --- > drivers/scsi/sg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c > index 79f05afa4407..e261260c1b8b 100644 > --- a/drivers/scsi/sg.c > +++ b/drivers/scsi/sg.c > @@ -2525,7 +2525,7 @@ sg_rq_end_io_usercontext(struct work_struct *work) > struct sg_fd *sfp; > > if (!srp) { > - WARN_ONCE("%s: srp unexpectedly NULL\n", __func__); > + WARN_ONCE(1, "%s: srp unexpectedly NULL\n", __func__); > return; > } > sfp = srp->parentfp; >
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 79f05afa4407..e261260c1b8b 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2525,7 +2525,7 @@ sg_rq_end_io_usercontext(struct work_struct *work) struct sg_fd *sfp; if (!srp) { - WARN_ONCE("%s: srp unexpectedly NULL\n", __func__); + WARN_ONCE(1, "%s: srp unexpectedly NULL\n", __func__); return; } sfp = srp->parentfp;
The WARN_ONCE() macro takes a condition and a warning message as parameters. This code accidentally left out the condition so it doesn't print a warning (just a stack trace). Fixes: ddfb8cbdf699 ("scsi: sg: Rework scatter-gather handling") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)