From nobody Thu Jan 04 14:30:18 2024 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 4T5TXD0Dnvz56Vtg; Thu, 4 Jan 2024 14:30:36 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T5TXC5QKgz4J0C; Thu, 4 Jan 2024 14:30:35 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704378635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yq/SJSLxviDZ4QVuHZMuu4WFBN9yNJb9hOxOJPUy9y0=; b=pMtDbs0WiT7ChZ1sptiDAtRmpKFlXXRejMTX7FmtQiDhkS4dj+2+GUQqry9k3Mv71aO4Su OcrSVBUfy/SJxCgLPlGU/deqlqYJb7juDMIELemh1zEVxXZr9U6aZpb5503ZI9oMfav6XU Y3svbgLv7L6VYyoBP5zRfTcKBwe81cmOkIU6xh3WVqOL0MPvOjB3zUhf564Ao1YCPqdUO4 eVVx28bKlnGBafadfyCMAu44LGeY+ACVQXfjJKI/uOls2lCWEtfXOLesIT+FVKbdKZdhE6 MG56QlvDL6yqs7UNpIvxisCTgPMshVPlgRYXcSjvh3huAQMs4ZuwZRUx70ufaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704378635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yq/SJSLxviDZ4QVuHZMuu4WFBN9yNJb9hOxOJPUy9y0=; b=D35aZjyztCpajWQSgRCJCywI0xa3zJDISWIATn33GuZIhiV1onZic8Jd4UaB+qH1gvZjly T5JuIqLKpmMLF8+ZAxNlYU0In9FBYlhEbN9gVzMzQmiEjLED1z3B3AjuZ1Zg2cDLsDCMa5 u2/XgoLPU0dBWRrwROt+CwJbSP7DREVsBFFLLoVkK5brsUaliLCcCniCkfOcm4pB1JuqIo QH2PpOCZQddDE1j1yMvn3oDqAcwFm/HlAlLy5fXVrg31dZUZEycuinsKvDvumScu9/MUcu xLKP4//M0fkZwM9MNMMQSUl+VuBekX0FbYnzXaItTSUlKd7Fo7Gb1Id65Z64HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704378635; a=rsa-sha256; cv=none; b=nZUcOxFdQVr+Yf4bjVrpazBr/7u12C/pex8odEszc/j0xkTW8zVhIQ5zyVenV/NcB5dIRB nI52meZvEDcIF/8ETxCrFJpk3pHhrBS5IMlYMwfWidU8lEuu+MG4E3+jc0KiwuswIIu1rg 8k5WPwH3mIpeWzL3SbU5CKyhg9LjXA8YnBtTB3dhFivb+Gf8yski7/1HIBe8KwtZeqBLv2 GptarrwzrQgwf8jSRLYGsLeCapSrPzFhv+Qb2Owgte0f+wkbilU88zkDKToALK1LN8wfZ7 /F8EGB4KKQw9Z2GSV5sxJo5LxZpRSMh5KGau0hZcaCKm1DhqJOzxsIxDv5lBdw== Received: from ravel.localnet (lfbn-nic-1-525-172.w90-118.abo.wanadoo.fr [90.118.140.172]) (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) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4T5TX951SXz1Vxt; Thu, 4 Jan 2024 14:30:33 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bd61c1e89dc4 - main - libthr: thr_attr.c: Clarity, whitespace and style Date: Thu, 04 Jan 2024 15:30:18 +0100 Message-ID: <2782916.iL6vRArjjl@ravel> In-Reply-To: References: <202401041044.404AiIN0046997@gitrepo.freebsd.org> 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: multipart/signed; boundary="nextPart85221458.0ko45tJjV3"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart85221458.0ko45tJjV3 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Olivier Certner To: Konstantin Belousov Date: Thu, 04 Jan 2024 15:30:18 +0100 Message-ID: <2782916.iL6vRArjjl@ravel> In-Reply-To: MIME-Version: 1.0 Hi Konstantin, This is the commit message: > > libthr: thr_attr.c: Clarity, whitespace and style > > > > Also, remove most comments, which don't add value. There was no intention on my side to make any other changes other than mostly mechanical ones to the existing code in this particular commit, which already is in itself a big diff. > The check is not needed. Indeed. It was there from the start. > there and in all similar places that test a flag bit I have already been told multiple times that testing a flag in an integer with '&' is to be assimilated as a boolean result, which per style(9) doesn't require explicit testing for non-zero. I think I even had to change code once in a review for this reason. I'm happy to change that if there can be a clear consensus on one way or the other. Additionally, this is not code I touched (except for indentation). > > + if ((pattr = malloc(sizeof(*pattr))) == NULL) > > + return (ENOMEM); > > + > > + memcpy(pattr, &_pthread_attr_default, sizeof(struct pthread_attr)); > Above you changed sizeeof(struct pthread_attr) to sizeof(*pattr), but > there you left the type name. Ah, indeed, thanks for spotting that inconsistency. > For me this looks somewhat confusing, in other places the explicit flag > name symbol is used instead of a variable value. With the assignment being in the preceding line, I'm not sure I share that sentiment, though I agree this is inconsistent with the 'else' branch. Happy to change it in a subsequent commit (original code is unchanged). > There should be a blank line after the local vars declaration. Yes, a style-fixup that I missed, thanks. > What is the point of doing calloc() if the whole allocated memory is > overwritten by the memcpy() call below? I agree this can be changed (in a subsequent pass, this is not a style issue, although arguably a clarity one). I'll make sure you're added to differential revisions changing this file. Thanks and regards. -- Olivier Certner --nextPart85221458.0ko45tJjV3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmWWwPoACgkQjKEwQJce JicgkQ//QctR4O6qseGMiofKrhtOSa0NDXzUkp2iHyoxYTz7AnaCQN8P7f2tJB2t kuXXYt8h3Ct+0uulkDnsoy9vaXS1A5kSlQ0+vby30Atgewaw9Tcfm45Pti4euw3j OYmCb3J+OikyRfF5uI7diOcN2DFKm/qRK+5WqkaYBTm9Rc2fKchV34lMZtqBIXUX mSeQSkNVUCOU6b760YHDOCrCfOuV/tQUyB55lYbITBDQZKsvzEUCiJ9D2vdgTvOW CpE+n6bCp9nLuBdO59rd3THNMdjujcxNmNeaxlrliE6pA2LGHiXOyCdQFy6bLccF ZOuY7F5PM9743JCFpkqbiXKJMiiY96lkrVgU0srUbaoAmRlmCFwLpdjzrH/yiLN1 7Vmq+Fk2yuX9AdtyMDAslRpWhSNTC2lajY263IUHF3qcyv5Vg06dkRoEfncKtFFX TIOimWIgjWqEVJoR6t6Klssz92urgW/rPk8bAnNOT9nAQqZCzFpV4U7EXy1ltkE7 W9DJR8XDJ5OkTarDqLPSOK0GVuWx5+r+ni1MQtYBQFF0/Nrds+4wvg86cicPexD8 errksz++WGfj8HMDH+1d25EbGX+pzE+z4z2XJLGKYpy0/S3eL9nmgK5VIcWwc/ky /AA3RMrDYaB66MWEuovuGlxIf72SFx0n6Kq8qW0gecwJQcs17TM= =nVL9 -----END PGP SIGNATURE----- --nextPart85221458.0ko45tJjV3--