Remove redundancy in vmtotal().

There are two instances of inlined unlocks + continue in vmtotal()
switch statements, which are ordinary expressed with break from the
switch case and code after the switch.  Also, the combination of
continue and break statement is redundand.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2016-12-26 19:29:04 +00:00
parent 5c36b2e8cb
commit 8b590e9506
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=310616

View File

@ -121,15 +121,10 @@ vmtotal(SYSCTL_HANDLER_ARGS)
*/
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
if (p->p_flag & P_SYSTEM)
if ((p->p_flag & P_SYSTEM) != 0)
continue;
PROC_LOCK(p);
switch (p->p_state) {
case PRS_NEW:
PROC_UNLOCK(p);
continue;
break;
default:
if (p->p_state != PRS_NEW) {
FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
switch (td->td_state) {
@ -146,15 +141,13 @@ vmtotal(SYSCTL_HANDLER_ARGS)
total.t_pw++;
}
break;
case TDS_CAN_RUN:
total.t_sw++;
break;
case TDS_RUNQ:
case TDS_RUNNING:
total.t_rq++;
thread_unlock(td);
continue;
break;
default:
break;
}