From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202408 header.b=ibE9lGvI; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A9D695A004C for ; Mon, 26 Aug 2024 11:53:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202408; t=1724666036; bh=hkz88pYSRx03JF0DFA0ra7s0VUTo8uEzT/hj9TV+TEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ibE9lGvIKIceVPCz4pi1GW+1DX7LahS4m4GkW90KiG3vzzDdMDJSrpZyLDXdxpmro Sgz/ldgAECMNUC1ga56/RreMvw+wZMfrB6ebD8cWCqjVyhnFFwCJFLFu0qZkpp1Hq5 OdbNEpt3tqbxuKzKx3B9ng7lYIScpLKwlw8hJ6UwX1uv7o02pm9xKK55yBEo9GyFXv eHjKcxQyG4XiPKYNPqUVnvRUWLr/bPv3be3jJ+V6iwjEwn7U0l8hvAljrujWR/vQie VgFMmu8yn40A0xdj7OOcExRJJbqkIyKoMCZrmf/Osg4zpX16rr61OmNWVgDtQ6gIjc fF5+yVRPHnP4g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WsmGX2vsHz4x81; Mon, 26 Aug 2024 19:53:56 +1000 (AEST) Date: Mon, 26 Aug 2024 19:53:49 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 3/4] vhost-user: introduce vhost-user API Message-ID: References: <20240815155024.827956-1-lvivier@redhat.com> <20240815155024.827956-4-lvivier@redhat.com> <20240823001422.6c441841@elisabeth> <20240826095542.6ebe2410@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CJe8iAaFU/3nQ3TQ" Content-Disposition: inline In-Reply-To: <20240826095542.6ebe2410@elisabeth> Message-ID-Hash: UXD2MGV2ZPPWHW72VNGNDRH42KFB7G6A X-Message-ID-Hash: UXD2MGV2ZPPWHW72VNGNDRH42KFB7G6A X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --CJe8iAaFU/3nQ3TQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 26, 2024 at 09:55:42AM +0200, Stefano Brivio wrote: > On Mon, 26 Aug 2024 15:27:59 +1000 > David Gibson wrote: >=20 > > On Fri, Aug 23, 2024 at 12:14:22AM +0200, Stefano Brivio wrote: > > > On Thu, 15 Aug 2024 17:50:22 +0200 > > > Laurent Vivier wrote: =20 > > [snip] > >=20 > > > > + if (sz_payload) { > > > > + do { > > > > + ret =3D recv(conn_fd, &vmsg->payload, sz_payload, 0); > > > > + } while (ret < 0 && (errno =3D=3D EINTR || errno =3D=3D EAGAIN))= ; =20 > > >=20 > > > No need for curly brackets, it's a one-line statement. =20 > >=20 > > Unlike if, while or for, I'm pretty sure the braces are mandatory for > > do {} while. >=20 > What do you mean by mandatory? This is not covered in any special way > by the kernel coding style documentation, and that statement is not a > compound statement: >=20 > $ cat dowhile.c > #include >=20 > int main() > { > int a =3D 3; >=20 > do > printf("%i\n", a--); > while (a); Huh. Ok, I'm just wrong. For some reason I thought the braces were required by C for do while. >=20 > return 0; > } > $ gcc -Wall -Wextra -pedantic -std=3Dc89 -o dowhile dowhile.c=20 > $ ./dowhile=20 > 3 > 2 > 1 >=20 > but sure, if you suggest that curly brackets improve clarity here, I > have nothing against them. Not what I was getting at, but I do think that's true. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --CJe8iAaFU/3nQ3TQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmbMUKwACgkQzQJF27ox 2GdxUw//dIqawVJr3wP0adab74MIp9Fqy+EY5xr3vWVeNgGHCGnXov0X/Kwfd21A 1KGAAxMl2JP6rDNxi8lZw6npsg6MdXTVNNi+932xc3CT09BcHOGwvp7rWADW8C6m u1Q7YWfbk2AGmLJq/cHcQCa06VQn4cqnrdnunmXoF71dAovDax5v6tEtZxJHi8cA vYTL7ty+EIXvSusm3dofcgRyPMBpzMlDMrFgt3tXsJYRAQq9SV/12r6HWXhRh9mv JXMeXLxAtHvlUol7P4geOdz4GBt09hKI/QIxepg/6+TGqZEAYGsPd4pCNHS4XU/f hMEDO1+cWDytpdPZdfQEWWKZs8m58H8k9IrLBU0NOtj9ra8cKL6tS2DrJxXB0j3T u92lAY9SHgxJLyi9oPUepI7wMVKDuUYzR5nuCk+uEPa8BWQ7EHNDrZ4rFk4LIV5T tN5JAoiuREHXAh7T1dFMD0OKnM+qAd5eVSGa+DK8OFllGDahdlADWLw6MEG/WkVe /QIfUaPhuoCohnFAh+TZq25Et9N7TzMknC6Ueo+8zFJAqiUEQlXsjwN7Q0hHKsVU BAZdzbmxyWeq7F/A0RNFkTCA+KJp4qkjYt/dYsUhdv1l4doQw30aJQM3a1l3mOYq s1Z5tDBrcOIcLXa1L8/syMXNxuSzWjRMYe7twk4DlX7zA41RQyE= =IWnB -----END PGP SIGNATURE----- --CJe8iAaFU/3nQ3TQ--