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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -357,6 +357,10 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra · 356 unmodified lines | |||
| 357 | } | 357 | } |
| 358 | smp_call_function(scf_handler, scfcp, scfsp->scfs_wait); | 358 | smp_call_function(scf_handler, scfcp, scfsp->scfs_wait); |
| 359 | break; | 359 | break; |
| 360 | default: | ||
| 361 | WARN_ON_ONCE(1); | ||
| 362 | if (scfcp) | ||
| 363 | scfcp->scfc_out = true; | ||
| 360 | } | 364 | } |
| 361 | if (scfcp && scfsp->scfs_wait) { | 365 | if (scfcp && scfsp->scfs_wait) { |
| 362 | if (WARN_ON_ONCE(!scfcp->scfc_out)) | 366 | if (WARN_ON_ONCE(!scfcp->scfc_out)) |