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=RMp86kpk; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D1E635A061A for ; Fri, 25 Oct 2024 03:04:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1729818252; bh=Jfw/zuY8mvJM0/qIdTFDwyoWHQeKlnC5oIflwoJ4EbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RMp86kpkyr5Dn2pjjBnQYOc7pChNgpl/P81xV+dDu2zj3Sb3mjxbG1uk1JfpgjVCq g42IlA4DNyYL3p3rBJxUTJ49VhHJoZs+wnN+Pws5Mc35NQVyVlKZIgq17teuDiCyZu FD/ccdnHdmZgKb+RLjKi/b36yHSgC6jp6v7UnP8/XTsJP018htPBGx7hmxmxqmu1+o 3ixxOOva4QXL3erODhnd5IMSmtFBnYhTD9MVAByoyaINSTXFUOum390RsXmWfuwxQX OaxULFDRWbwT+1QuzR68iSnc3CVV2M3rLpC+zD/OilNuj74iLG9Ka52IbxU5LsPGET VVlM9rWaqXf2g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XZPgc0lMHz4x3J; Fri, 25 Oct 2024 12:04:12 +1100 (AEDT) Date: Fri, 25 Oct 2024 12:02:17 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 7/8] udp: Take care of cert-int09-c clang-tidy warning for enum udp_iov_idx Message-ID: References: <20241024230438.3192725-1-sbrivio@redhat.com> <20241024230438.3192725-8-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Z4zcnZjAYgeWMPa+" Content-Disposition: inline In-Reply-To: <20241024230438.3192725-8-sbrivio@redhat.com> Message-ID-Hash: NV6C66L6TTVPMGJRTJKRJZQ2G6YAHJLQ X-Message-ID-Hash: NV6C66L6TTVPMGJRTJKRJZQ2G6YAHJLQ 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: --Z4zcnZjAYgeWMPa+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 25, 2024 at 01:04:37AM +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 > Make sure we initialise all the values, in this case. Oof. Although it's a bit weird, I quite like the existing style, because it gives the correct value for NUM_WHATEVER without requiring editing if a new explicit value is inserted above it. I'd be inclined to use a suppression rather than changing the code. >=20 > Signed-off-by: Stefano Brivio > --- > udp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/udp.c b/udp.c > index 100610f..89f2959 100644 > --- a/udp.c > +++ b/udp.c > @@ -173,7 +173,7 @@ enum udp_iov_idx { > UDP_IOV_ETH =3D 1, > UDP_IOV_IP =3D 2, > UDP_IOV_PAYLOAD =3D 3, > - UDP_NUM_IOVS > + UDP_NUM_IOVS =3D UDP_IOV_PAYLOAD + 1, > }; > =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 --Z4zcnZjAYgeWMPa+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmca7hkACgkQzQJF27ox 2GdNuw/9FNWtr4feebvBSfxjNUrxmWUaYtC51LY3s+qQRMWO4hI9G+l7Kgy9i1Lc ksnLQY5YmiqY4QQ9CP1i/s8A/qNd8Od7yGsqrYgxPJIfmbY9qWgRex/IYuEo8B99 ENjmC6l3qHod/Yc0FvfInicOkAX0NTzPy5DqkjGTx5NX8ti0TYPCuQ9CLtr18kk/ Hm3wAq4nrBeUx+hc85reaOI5INehM+z78KeVY1z1fq9WdB0juIc3SVQAoCqtBoLC +pCzLnVQCV6eM6e9z6wyipEizS/ZCtyLnrUopfRJMghKWzQdp8+Bxfw/r5Do7O6y NfyfoFWy7OLTxJFqZC7eLgoZHrtAkCnko3LVI4osQmq8l0p9YUWNpMnG3KU1Wrwp NH31tzURZ/xBppT+c46OqNNT5Jr0qcbZhEgclTPQxMxRuGF27famp67PfufL/maI 0GsRlAd7MDQeIPVfkdYVsZwgSxgVt8ZOh20kT5ZaWoo1U6A7/ArGeZ3066h8FhxW 3ftD9ghHnqn3s522QfL187qSYCHdN+kqyb1J4ubUv7tKf4mxEQDpu1z0dsdejVh6 3kWwxqtz2q8KCLzcatGMhOh561IHqcF0Mse3RZihFqI0zvsaUC06XXPk7eE/hHEx KKV5QyaKG1P939j4kPoXtxt7zNokFJF62Pcb08RrAOye6WlUgmQ= =5DW1 -----END PGP SIGNATURE----- --Z4zcnZjAYgeWMPa+--