From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH 1/8] Improve types and names for port forwarding configuration Date: Sat, 24 Sep 2022 00:52:57 +0200 Message-ID: <20220924005257.0c325e20@elisabeth> In-Reply-To: <20220923045806.956143-2-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3848157696191543402==" --===============3848157696191543402== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, 23 Sep 2022 14:57:59 +1000 David Gibson wrote: > [...] >=20 > --- /dev/null > +++ b/port_fwd.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: AGPL-3.0-or-later > + * Copyright Red Hat > + * Author: Stefano Brivio > + * Author: David Gibson > + */ > + > +#ifndef PORT_FWD_H > +#define PORT_FWD_H > + > +enum port_fwd_mode { > + FWD_SPEC =3D 1, > + FWD_NONE, > + FWD_AUTO, > + FWD_ALL, > +}; > + > +typedef uint8_t port_fwd_map[DIV_ROUND_UP(USHRT_MAX, 8)]; Given that this gets conveniently embedded in a struct in 2/8, could we avoid the typedef (or perhaps drop it after 2/8)? It makes the actual type less obvious to figure out, and in general I agree with most points from this slide deck: http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/mgp0= 0025.html :) ...well, unless there's some resulting complexity I'm missing. I reviewed the rest of the series, it all makes sense to me, thanks. --=20 Stefano --===============3848157696191543402==--