From nobody Sat Sep 09 08:27:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RjR1n439Vz4sPLt; Sat, 9 Sep 2023 08:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RjR1n3bvKz4N43; Sat, 9 Sep 2023 08:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694248077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rfmlgm68ugrfmUWOyNL1IRYaZbjLTMGFw6zK2mPsdBA=; b=Cl6CosX2lY75QsBdyPp92r6KQVwipjKScaHirHepiZu4LHLkNJ5UKBlrM+glfbGeN224CQ x2Wa9o4JzE9Zdg4VE5u9JmvaYgJU2Ch+gFb8VPFj8G7Qzclh8ApmFh3f0v2LiGnuDGjuL6 hmwpLMZePaTHI2p/sPQiPDY/XSDHy1eIkQ5u52Lw0Box89yxogxSSUxf7EbYG+bxPhgaRX 0AqqobgG2QRadDdPfMahLnMPiZwqb01NIFGlTolmZAXaaMduDkkJc2h/WOWF8ssyBksrUk RhbsIfZCglZ3RVxF+jbOka2oWcYbhAlGTtD1GFHftQx42aGgbZ0bxWVU+eRIkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694248077; a=rsa-sha256; cv=none; b=ZGCWRHyjfUxyIwX9BBCOmzk00wNTl/fZwQd1yewaX/LUqlwP/R7VpWZ8r80LgT2onPzJeH 0cldcE3QL3btRhutlma1DGofpr6NnpUk4igxfdhrMMxV2rJgeDI8tUBK35bPWQP4aTEdQu rpxehU0kEEIbmw5upb8O/WQX7/S8Lw+cOKUmsVmTX/g+s2JmndA34CjywCTOyvTNpyXX6w PkuYigLrSCbkAY5oWPM1pt4ZGSdLuP6nTtWAV3JHwblddaFN/RZAzwq9mu4bqmdYR5lH3+ powYno4N5DQ4Lpqj9mlIRDc5FacGaMXEeDnckFIVi9Lwqi3gHRFGpAcz0IjKEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694248077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rfmlgm68ugrfmUWOyNL1IRYaZbjLTMGFw6zK2mPsdBA=; b=B974dqOI37zbuvFhyCVlrSeKKkJ1HhJ4lVRFBOpq50AWnHxB9wZgSkv6XkCvIaRT3RknOO 98v+NGLj0LuYfV67b8VkxkaTsiZIvHKvGq5OhaAminGtFb/w9/acyQrTkoT1sGUKr7cxOX Fp3i3il0vw4XaZdQnDOAcD+rBVq3dpjl9pusHxNoQVmy0salzOHJps7PQfIRKxyrsQR78m Mpdoocwele+rnub1M1uF1SmDuoc67NXf61cu/NYBhptdzDdHIfy3XCj0UCG7bxal6F8bvL HqVQ8E8FLFVI+7y3y0p0pIDfsWfSeuOB0+2jm1COpARHv3qJUCbyuEDorQNr0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RjR1n2bW4z38L; Sat, 9 Sep 2023 08:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3898RvUH054002; Sat, 9 Sep 2023 08:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3898RvpU053999; Sat, 9 Sep 2023 08:27:57 GMT (envelope-from git) Date: Sat, 9 Sep 2023 08:27:57 GMT Message-Id: <202309090827.3898RvpU053999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2ccb043eb818 - stable/13 - kern_kthread.c: some style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ccb043eb818b7d3cc31c72d26cff143c79dadcd Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ccb043eb818b7d3cc31c72d26cff143c79dadcd commit 2ccb043eb818b7d3cc31c72d26cff143c79dadcd Author: Konstantin Belousov AuthorDate: 2023-09-02 07:05:49 +0000 Commit: Konstantin Belousov CommitDate: 2023-09-09 08:27:32 +0000 kern_kthread.c: some style (cherry picked from commit ea70866bb15dd707c1a6a729c44e5ae611c83dd1) --- sys/kern/kern_kthread.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index bf481cafc72e..3604d63531da 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -63,7 +63,7 @@ kproc_start(const void *udata) int error; error = kproc_create((void (*)(void *))kp->func, NULL, - kp->global_procpp, 0, 0, "%s", kp->arg0); + kp->global_procpp, 0, 0, "%s", kp->arg0); if (error) panic("kproc_start: %s: error %d", kp->arg0, error); } @@ -97,8 +97,8 @@ kproc_create(void (*func)(void *), void *arg, fr.fr_pages = pages; fr.fr_procp = &p2; error = fork1(&thread0, &fr); - if (error) - return error; + if (error != 0) + return (error); /* save a global descriptor, if desired */ if (newpp != NULL) @@ -134,12 +134,12 @@ kproc_create(void (*func)(void *), void *arg, sched_user_prio(td, PUSER); /* Delay putting it on the run queue until now. */ - if (!(flags & RFSTOPPED)) + if ((flags & RFSTOPPED) == 0) sched_add(td, SRQ_BORING); else thread_unlock(td); - return 0; + return (0); } void @@ -188,7 +188,8 @@ kproc_suspend(struct proc *p, int timo) } SIGADDSET(p->p_siglist, SIGSTOP); wakeup(p); - return msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, "suspkp", timo); + return (msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, + "suspkp", timo)); } int @@ -230,11 +231,11 @@ kproc_suspend_check(struct proc *p) void kthread_start(const void *udata) { - const struct kthread_desc *kp = udata; + const struct kthread_desc *kp = udata; int error; error = kthread_add((void (*)(void *))kp->func, NULL, - NULL, kp->global_threadpp, 0, 0, "%s", kp->arg0); + NULL, kp->global_threadpp, 0, 0, "%s", kp->arg0); if (error) panic("kthread_start: %s: error %d", kp->arg0, error); } @@ -313,13 +314,13 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_CREATE_LOG, NULL); #endif /* Delay putting it on the run queue until now. */ - if (!(flags & RFSTOPPED)) { + if ((flags & RFSTOPPED) == 0) { thread_lock(newtd); sched_add(newtd, SRQ_BORING); } if (newtdp) *newtdp = newtd; - return 0; + return (0); } void @@ -451,8 +452,8 @@ kthread_suspend_check(void) int kproc_kthread_add(void (*func)(void *), void *arg, - struct proc **procptr, struct thread **tdptr, - int flags, int pages, const char *procname, const char *fmt, ...) + struct proc **procptr, struct thread **tdptr, + int flags, int pages, const char *procname, const char *fmt, ...) { int error; va_list ap; @@ -461,7 +462,7 @@ kproc_kthread_add(void (*func)(void *), void *arg, if (*procptr == NULL) { error = kproc_create(func, arg, - procptr, flags, pages, "%s", procname); + procptr, flags, pages, "%s", procname); if (error) return (error); td = FIRST_THREAD_IN_PROC(*procptr); @@ -479,6 +480,6 @@ kproc_kthread_add(void (*func)(void *), void *arg, vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); error = kthread_add(func, arg, *procptr, - tdptr, flags, pages, "%s", buf); + tdptr, flags, pages, "%s", buf); return (error); }