From nobody Tue Jan 14 23:36:10 2025 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 4YXlrC11Rpz5kbK8; Tue, 14 Jan 2025 23:36:11 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXlrC06z7z3S4r; Tue, 14 Jan 2025 23:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736897771; 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=1PHLfCKsCU+39rEEy0Y8vVZyUC+d04oaekZ9k5emcHM=; b=vFhTzdEtMSgmHVsd6rEPpyqPs9ljBPnwznaO+E1gwp5p3+wj+4+eMHvOy7nzR0MHGC5G6r GhdNTCu8iCIeOc0BULgOLHCensN+psths4YSjAHK66Iu2vKzLe9a1ztnxBE/e2RgIGu3Fb Uvqjuh1UKVoz8iBXXxRDFCUgrEByP6pmBNeU76kiR19Rl7Y4jqL2dSwvgzzJH5eaKjVCXh wlskxYkW3obx//e/kMHdiwwl63O44480G/OoVvt8bmvFtO7Z9G+8gtU0TuXqOduXFnmcLH jZ51JJG7aSZomGhwR88TTnfA2LaC+BlGaMVY3JMUiF4QI3NlQPxlulFfP/9Plw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736897771; 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=1PHLfCKsCU+39rEEy0Y8vVZyUC+d04oaekZ9k5emcHM=; b=XObbz+4xuZTTsxqlueXOpj+6kV3W4Qikzxt3AgBMiGZLGY1CjBpIlLFhx86S6liqBMKVUr GUzaG822aAZqmYb1gXffa8rolebtjEgDosXSC0V3I7VbkJEe06bfP5mTiJ4fxniS7Lc59l qFMcHkoFqbqmqSuoYy6MHL4i0mE1SRd7rw8HcxpT/pNkv4SZ9r6YPYP3ukAuFCQbhX0Ll+ L1UxUNb9SKmOkrsUBs7GjI1PrfuPHVHkD5P+gd2RQxbxy3VEgg7FoDyIJSFILPeHTTm4cm V1M7AX4m29FrXPaEqBoyL8nNlkHsXyk63BdF5/EhQ4Vj5TbvUSgLeS6xrAi2Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736897771; a=rsa-sha256; cv=none; b=wVlSwZ6rXjKRdc3Tj8P8HPFr/iQ+iO75S/SbG9QavMKAbfsZKmG7USzT4IowuMUhn6uROF GwC90mt0IDUhVUMQfvwMx9usebRvQlIVAroQvYRPNbl2HpTS0pi1F6Tb5dVZOreIZwrofY 60GlzQ7V8yNvatgBJPc/4AWYOLqMVgw0fv1On3TnP21fElTjX44gwO3i94FDdoIc/XlVS0 CfRzHq7dSv9dOAzX+v9rPlLEqsv0D0xxtJCYcWmBn+DIeXXUHivzWEjJqD9C5obXFRh+LU g5ynRyVNamLGzJ9tNJusOlRz51XN7Esbml9A0Z8+k6wllceXQq0LmHnWBJ58VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YXlrB6fHqz6Lm; Tue, 14 Jan 2025 23:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ENaA2x011141; Tue, 14 Jan 2025 23:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ENaAp2011138; Tue, 14 Jan 2025 23:36:10 GMT (envelope-from git) Date: Tue, 14 Jan 2025 23:36:10 GMT Message-Id: <202501142336.50ENaAp2011138@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: 02703de8bcae - main - pthread_create(): 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 02703de8bcae3b45e6d96e8467d5fa512d62cc3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02703de8bcae3b45e6d96e8467d5fa512d62cc3d commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d Author: Konstantin Belousov AuthorDate: 2025-01-14 23:32:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 23:35:38 +0000 pthread_create(): style Use NULL instead of 0 for null pointer. Use != 0 for non-bool, as in the rest of the function. Remove unneeded (). Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 4de9bd84ca5b..2ae7cf0cd7b2 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -146,7 +146,7 @@ _pthread_create(pthread_t * __restrict thread, _thr_stack_fix_protection(new_thread); /* Return thread pointer eariler so that new thread can use it. */ - (*thread) = new_thread; + *thread = new_thread; if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { THR_THREAD_LOCK(curthread, new_thread); locked = 1; @@ -226,8 +226,8 @@ _pthread_create(pthread_t * __restrict thread, THR_THREAD_UNLOCK(curthread, new_thread); } out: - if (ret) - (*thread) = 0; + if (ret != 0) + *thread = NULL; return (ret); }