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=202410 header.b=afP9sNct; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 9BBCA5A061B for ; Mon, 28 Oct 2024 03:14:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730081660; bh=sqwbGmGvNoLz4FE8avJxs8LZPOu1Bbhda2gVUh9KJm0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=afP9sNctSDZ19nj//mX3NwGbYgfdNznv2qbaUbK8ov1hq1KiSb5dKZtxjT2tyyfuv 9dPE1gCpbclMSzz9ebztT5c8gGlFE13ALmW4dbCtePppFcz+0ZEvp1p7nbqpPhw8vw u657+ZF8kSKC8QinQOdZzXkaT80aJ1dOCmevdvoAfoHQEFn+Ew2PLnaI9nYeuDCrII ls6OW3TeDi0ZYps4KmS625dwv8EV+ZREco7KkJ/dNKmywA2bKxftNxxvWMWmcqBymI AUXxhtKFplBNul0ZlkT10bf8DJ5C1NUrdeiYYK0md1dXG8EaoCF6NX6a+/S0V04UTm hCGiiMNf3KxGw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XcH5861ZCz4x8C; Mon, 28 Oct 2024 13:14:20 +1100 (AEDT) Date: Mon, 28 Oct 2024 12:02:17 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 7/8] udp: Take care of cert-int09-c clang-tidy warning for enum udp_iov_idx Message-ID: References: <20241025120814.3449347-1-sbrivio@redhat.com> <20241025120814.3449347-8-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DIbNjJpMyfJDNV1m" Content-Disposition: inline In-Reply-To: <20241025120814.3449347-8-sbrivio@redhat.com> Message-ID-Hash: VJQRPBDOKU22NH7JG7SB3PWFPKS4MYXG X-Message-ID-Hash: VJQRPBDOKU22NH7JG7SB3PWFPKS4MYXG 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: 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: --DIbNjJpMyfJDNV1m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 25, 2024 at 02:08:13PM +0200, Stefano Brivio wrote: > /home/sbrivio/passt/udp.c:171:1: error: inital values in enum 'udp_iov_id= x' are not consistent, consider explicit initialization of all, none or onl= y the first enumerator [cert-int09-c,readability-enum-initial-value,-warnin= gs-as-errors] > 171 | enum udp_iov_idx { > | ^ > 172 | UDP_IOV_TAP =3D 0, > 173 | UDP_IOV_ETH =3D 1, > 174 | UDP_IOV_IP =3D 2, > 175 | UDP_IOV_PAYLOAD =3D 3, > 176 | UDP_NUM_IOVS > | > | =3D 4 >=20 > Don't initialise any value, so that it's obvious that constants map to > unique values. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > udp.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/udp.c b/udp.c > index 100610f..0c01067 100644 > --- a/udp.c > +++ b/udp.c > @@ -169,11 +169,11 @@ udp_meta[UDP_MAX_FRAMES]; > * @UDP_NUM_IOVS the number of entries in the iovec array > */ > enum udp_iov_idx { > - UDP_IOV_TAP =3D 0, > - UDP_IOV_ETH =3D 1, > - UDP_IOV_IP =3D 2, > - UDP_IOV_PAYLOAD =3D 3, > - UDP_NUM_IOVS > + UDP_IOV_TAP, > + UDP_IOV_ETH, > + UDP_IOV_IP, > + UDP_IOV_PAYLOAD, > + UDP_NUM_IOVS, > }; > =20 > /* IOVs and msghdr arrays for receiving datagrams from sockets */ --=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 --DIbNjJpMyfJDNV1m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmce4pgACgkQzQJF27ox 2GeyrxAAqFlxnsdvQJKp/1m6towlWMOHdb2JfTMRdgdM4l+i5KyTbvkp6fg2DOmg yQvBHmCl0UvwrRxiiOQLTPLMm9Yrmy4M3PdP/yhu4ICuXNvzezewE+mjsI3cw5an A2QDGEKreScehgqPlF4QJklX6cWCXNyjulvauRe2+oyUiJg77VtKgkzNcmrsW/Cj KR3oEdwQXR2dgi8+BvBaDH5VHQh0rhEfn/B/xz3FuFQUIz7GrSjjvpueX6GV5XZn XOZFQvKwsaQhyYbxoZZB1Y5Pf3mAJXGDMaO/PnWXluWrGUdyvb86Pyh7nsP6v3ru 5iANqiGzSbme5XmMeqS2f/HnMVhQKuVC9EDCpeonKNmE3oXwkBP9VUGQsqGcZEH3 BN/FbKykjPlqCcRRP4txmbJptn1nmadr69AvcmVDrELYy2uOTCu31CG5U1hcVhiv 6H9BFR5cyI2zUrpuEiq/DApqsKiUDrKJnq+mhK70nrDguUMJxL3ZRS6hIhl4uTGN CIMEhrg+T4xS8ywV5YDQzF0yrisY/D1ML9QloQ+1kBtDE6Q/rbHwnqwSKpxNILu5 ik/IqMYDOdiEzieNX2iWWcoayEMLqlGnq6A9DKrD96ZS/qLF/M5JWlsUCKPFzakP d5gQEJPioCp/eo9I+RFzISGJfGD8k6FEBEdouBiDW8w4kvL9wwc= =q6Xl -----END PGP SIGNATURE----- --DIbNjJpMyfJDNV1m--