From nobody Sun Sep 03 05:22:32 2023 X-Original-To: dev-commits-src-main@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 4RdgBd1jC8z4rFTR; Sun, 3 Sep 2023 05:22:33 +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 4RdgBc6VRPz4bGK; Sun, 3 Sep 2023 05:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693718552; 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=DjEjJF820xtsjcMJEGVrhS61KpK7pStbq7wGRpEXZ4M=; b=mELV00SqcaLLpHCD8Qip/UZr1R7b1myDptEDe8nZzVuxMn3jsqwjHvYWUAuVKnXivrW5Nz zLfpYlYymChHR8St5jJoqRcOOC0uXFeIK9aXcanyWRQIdsD4735L0B7kJM8S9x6WtQOKhj KVU1jSfwYiUXuN+hOTIfQ5P3r+41VRmQkitLp1EcNKOQzZeYGWYDAMrplABQDJ/WTugNxZ KEEHewwHm4COI1vqFxQYNoYhbAvywgG/t2pWTBkhqESBcpvbgwxeQIiNic8kLvzjUSMD0e Bp3GZEwJMSyBf3cjCLGqeAKGj58Ryzs+JWuNR7gtm3nNMPI3HVBCOIzJwKYQXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693718552; a=rsa-sha256; cv=none; b=LsRNmmQZIoxj8MjS3JP7tX6gScDLFLEK9EGOn7OZxX6XwJp+a/vQb2evgxu0ZkomuawO3s womg9JKNz4gpVbimHwIigTzULiR+1MTCU2lFG13x7wlKeFZN/T4Co60kRUJgfl7dud2Aeq 8Ty51PsUgZcLovSNijiHX6i2LTmOVzYH2In6Zw+pWnIOzcctDTRJzwkWpJG9lzClNeYVrr i4DihM+FNowvwqfIfykO9AD0pN5LeYqYQ5/paDrychBFEFutpgpDH87ur1JGTXa4VMC2bW LgwVHcR5cAgReYI+3HXgmJemOWkbkCGmI/mv9/eWGJK5wtQgm0SBU3fO6tE9dA== 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=1693718552; 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=DjEjJF820xtsjcMJEGVrhS61KpK7pStbq7wGRpEXZ4M=; b=kHiTrpRgZ/ZQa9y8l7oYMFwezgE8XETY5ia+6ImAZttM9F65l0FVmOtJFdt2J/WPcxfYzG JD9FbvIcLWnQF2VIg9Pn/T5LItbkHIauzQBrHZlL3wnT+vn57Cgv4MsFD302sCIv8t1tR1 VzyYZ+lpk424+1GdFXVpW4xhlKOELK6NZEW5sY2u9E4wM5OrPXtsJeyFyXJ8d5s7qGTMBn YZcjfdZJwfd7SMA6V8y5jfGVH50Fzoyz+aMITPIMm/g6KXtad9zmddfe+ORzUxJD6FpjEP AeGwIWlclEaEXeVsdVjH/S7Yy9/Z5PVGp7yQ/8mDegrbW2k4UQQj0+rK67md5g== 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 4RdgBc5bPVz1C5y; Sun, 3 Sep 2023 05:22:32 +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 3835MWDF099985; Sun, 3 Sep 2023 05:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3835MWi8099982; Sun, 3 Sep 2023 05:22:32 GMT (envelope-from git) Date: Sun, 3 Sep 2023 05:22:32 GMT Message-Id: <202309030522.3835MWi8099982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ea70866bb15d - main - kern_kthread.c: some style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ea70866bb15dd707c1a6a729c44e5ae611c83dd1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ea70866bb15dd707c1a6a729c44e5ae611c83dd1 commit ea70866bb15dd707c1a6a729c44e5ae611c83dd1 Author: Konstantin Belousov AuthorDate: 2023-09-02 07:05:49 +0000 Commit: Konstantin Belousov CommitDate: 2023-09-03 05:21:44 +0000 kern_kthread.c: some style Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41694 --- 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); }