diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-12-26 19:29:04 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-12-26 19:29:04 +0000 |
commit | 8b590e95069ab9c3de3c9da4cae3ff62583c8ac0 (patch) | |
tree | d1f66eac8f423e2da84e0a2930b461f7ec0d2f18 /sys/vm/vm_meter.c | |
parent | 5c36b2e8cb3baa1375b2ba0ef7c68a0dd820c0f7 (diff) | |
download | src-8b590e95069ab9c3de3c9da4cae3ff62583c8ac0.tar.gz src-8b590e95069ab9c3de3c9da4cae3ff62583c8ac0.zip |
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
Notes
Notes:
svn path=/head/; revision=310616
Diffstat (limited to 'sys/vm/vm_meter.c')
-rw-r--r-- | sys/vm/vm_meter.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 941059ab6ce9..379dd8fde45c 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -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; } |