aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-12-14 03:53:50 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-12-16 04:43:06 +0000
commit9b943425fd90858f9e21cf47009275943a3548a3 (patch)
tree2a05c299c209a48b14cfd8780c245fa5090c8bc7
parent094626d3a5009a56bf1b763dbdfc681ce371dc99 (diff)
proc_dtor(): style improvements
Drop not needed cast. Group sigchld state check as single KASSERT condition. Remove useless comment. Reviewed by: des, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54234
-rw-r--r--sys/kern/kern_proc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 8f86ce349e30..05b1ed990025 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -237,11 +237,10 @@ proc_dtor(void *mem, int size, void *arg)
struct proc *p;
struct thread *td;
- /* INVARIANTS checks go here */
- p = (struct proc *)mem;
+ p = mem;
td = FIRST_THREAD_IN_PROC(p);
if (td != NULL) {
- KASSERT((p->p_numthreads == 1),
+ KASSERT(p->p_numthreads == 1,
("too many threads in exiting process"));
/* Free all OSD associated to this thread. */
@@ -256,8 +255,7 @@ proc_dtor(void *mem, int size, void *arg)
#ifdef KDTRACE_HOOKS
kdtrace_proc_dtor(p);
#endif
- if (p->p_ksi != NULL)
- KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue"));
+ KASSERT(p->p_ksi == NULL || !KSI_ONQ(p->p_ksi), ("SIGCHLD queue"));
}
/*