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

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