git: f5acbacb28f9 - main - kern/kern_exit.c: some style

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 25 Jan 2026 15:56:45 UTC
The branch main has been updated by kib:

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

commit f5acbacb28f9fec7b9f159d36cc5056c9267a8ca
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-08 04:35:51 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-25 15:52:39 +0000

    kern/kern_exit.c: some style
    
    Reviewed by:    asomers, markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D54592
---
 sys/kern/kern_exit.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index c4b1c8201ff2..d7fa280e3711 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -924,9 +924,9 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options)
 
 	q = td->td_proc;
 
-	if (status)
+	if (status != NULL)
 		*status = KW_EXITCODE(p->p_xexit, p->p_xsig);
-	if (options & WNOWAIT) {
+	if ((options & WNOWAIT) != 0) {
 		/*
 		 *  Only poll, returning the status.  Caller does not wish to
 		 * release the proc struct just yet.
@@ -1114,7 +1114,7 @@ proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id,
 		return (0);
 	}
 
-	if (((options & WEXITED) == 0) && (p->p_state == PRS_ZOMBIE)) {
+	if ((options & WEXITED) == 0 && p->p_state == PRS_ZOMBIE) {
 		PROC_UNLOCK(p);
 		return (0);
 	}
@@ -1351,12 +1351,11 @@ loop_locked:
 			    (p->p_flag & P_WAITED) == 0);
 			PROC_SUNLOCK(p);
 			if (report) {
-			CTR4(KTR_PTRACE,
-			    "wait: returning trapped pid %d status %#x "
-			    "(xstat %d) xthread %d",
-			    p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig,
-			    p->p_xthread != NULL ?
-			    p->p_xthread->td_tid : -1);
+				CTR4(KTR_PTRACE,
+	    "wait: returning trapped pid %d status %#x (xstat %d) xthread %d",
+				    p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig,
+				    p->p_xthread != NULL ?
+				    p->p_xthread->td_tid : -1);
 				report_alive_proc(td, p, siginfo, status,
 				    options, CLD_TRAPPED);
 				return (0);
@@ -1412,20 +1411,20 @@ loop_locked:
 		sx_xunlock(&proctree_lock);
 		return (ECHILD);
 	}
-	if (options & WNOHANG) {
+	if ((options & WNOHANG) != 0) {
 		sx_xunlock(&proctree_lock);
 		td->td_retval[0] = 0;
 		return (0);
 	}
 	PROC_LOCK(q);
-	if (q->p_flag & P_STATCHILD) {
+	if ((q->p_flag & P_STATCHILD) != 0) {
 		q->p_flag &= ~P_STATCHILD;
 		PROC_UNLOCK(q);
 		goto loop_locked;
 	}
 	sx_xunlock(&proctree_lock);
 	error = msleep(q, &q->p_mtx, PWAIT | PCATCH | PDROP, "wait", 0);
-	if (error)
+	if (error != 0)
 		return (error);
 	goto loop;
 }