Skip to contentSkip to conversation

scsi: sg: Fix a warning message

PATCH In review Dan Carpenter 2 participants 2 messages Mar 12, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: sg: Fix a warning message

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")
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sg.c +1 -1
index 79f05afa4407..e261260c1b8b 100644
@@ -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;
Signature · 1 line
2.30.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

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")

This one wasn't addressed yesterday, thanks.

Quoted 18 lines
---
  drivers/scsi/sg.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sg.c +1 -1
index 79f05afa4407..e261260c1b8b 100644
@@ -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;