The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9b943425fd90858f9e21cf47009275943a3548a3

commit 9b943425fd90858f9e21cf47009275943a3548a3
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2025-12-14 03:53:50 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2025-12-16 04:43:06 +0000

    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
---
 sys/kern/kern_proc.c | 8 +++-----
 1 file 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"));
 }
 
 /*

Reply via email to