History

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.

Paul E. McKenney committed 6 years ago

Commit de77d4d1 parent 9a52a571 file · +4 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/scftorture.c+4−0
@@ -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))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t