Skip to content

Commit de77d4d

Browse files
committed
scftorture: Check unexpected "switch" statement value
This commit adds a "default" case to the switch statement in scftorture_invoke_one() which contains a WARN_ON_ONCE() and an assignment to ->scfc_out to suppress knock-on warnings. These knock-on warnings could otherwise cause the user to think that there was a memory-ordering problem in smp_call_function() instead of a bug in scftorture.c itself. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 9a52a57 commit de77d4d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/scftorture.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra
357357
}
358358
smp_call_function(scf_handler, scfcp, scfsp->scfs_wait);
359359
break;
360+
default:
361+
WARN_ON_ONCE(1);
362+
if (scfcp)
363+
scfcp->scfc_out = true;
360364
}
361365
if (scfcp && scfsp->scfs_wait) {
362366
if (WARN_ON_ONCE(!scfcp->scfc_out))

0 commit comments

Comments
 (0)