Date: Sat, 15 May 2021 22:41:53 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Lutz Donnerhacke <donner@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: effc8e57fbf0 - main - libalias: Style cleanup Message-ID: <YKAkAcYHXN7XMyoL@kib.kiev.ua> In-Reply-To: <202105150701.14F717lf084359@gitrepo.freebsd.org> References: <202105150701.14F717lf084359@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 15, 2021 at 07:01:07AM +0000, Lutz Donnerhacke wrote: > The branch main has been updated by donner: > > URL: https://cgit.FreeBSD.org/src/commit/?id=effc8e57fbf03d7f1423c662caf2b63f0d1d21a9 > > commit effc8e57fbf03d7f1423c662caf2b63f0d1d21a9 > Author: Lutz Donnerhacke <donner@FreeBSD.org> > AuthorDate: 2021-05-14 13:08:08 +0000 > Commit: Lutz Donnerhacke <donner@FreeBSD.org> > CommitDate: 2021-05-15 06:57:55 +0000 > > libalias: Style cleanup > > libalias is a convolut of various coding styles modified by a series > of different editors enforcing interesting convetions on spacing and > comments. > > This patch is a baseline to start with a perfomance rework of > libalias. Upcoming patches should be focus on the code, not on the > style. That's why most annoying style errors should be fixed > beforehand. > > Reviewed by: hselasky > Discussed by: emaste > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D30259 > --- > sys/netinet/libalias/alias.c | 379 ++++++++++++++++----------------- > sys/netinet/libalias/alias.h | 44 ++-- > sys/netinet/libalias/alias_db.c | 414 +++++++++++++++++------------------- > sys/netinet/libalias/alias_dummy.c | 15 +- > sys/netinet/libalias/alias_ftp.c | 68 +++--- > sys/netinet/libalias/alias_irc.c | 52 +++-- > sys/netinet/libalias/alias_local.h | 178 +++++++--------- > sys/netinet/libalias/alias_mod.c | 2 - > sys/netinet/libalias/alias_nbt.c | 253 ++++++++++------------ > sys/netinet/libalias/alias_pptp.c | 84 ++++---- > sys/netinet/libalias/alias_proxy.c | 271 ++++++++++++----------- > sys/netinet/libalias/alias_sctp.c | 138 ++++++------ > sys/netinet/libalias/alias_sctp.h | 26 +-- > sys/netinet/libalias/alias_skinny.c | 30 ++- > sys/netinet/libalias/alias_smedia.c | 91 ++++---- > sys/netinet/libalias/alias_util.c | 30 +-- > 16 files changed, 975 insertions(+), 1100 deletions(-) > > diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c > index 900731fcbec6..cac19ab55d56 100644 > --- a/sys/netinet/libalias/alias.c > +++ b/sys/netinet/libalias/alias.c > @@ -146,7 +146,7 @@ __FBSDID("$FreeBSD$"); > #include "alias_mod.h" > #endif > > -/* > +/* > * Define libalias SYSCTL Node > */ > #ifdef SYSCTL_NODE > @@ -192,7 +192,6 @@ static void TcpMonitorOut(u_char, struct alias_link *); > static void > TcpMonitorIn(u_char th_flags, struct alias_link *lnk) > { > - > switch (GetStateIn(lnk)) { This was style-compatible. > case ALIAS_TCP_STATE_NOT_CONNECTED: > if (th_flags & TH_RST) > @@ -210,7 +209,6 @@ TcpMonitorIn(u_char th_flags, struct alias_link *lnk) > static void > TcpMonitorOut(u_char th_flags, struct alias_link *lnk) > { > - > switch (GetStateOut(lnk)) { > case ALIAS_TCP_STATE_NOT_CONNECTED: > if (th_flags & TH_RST) > @@ -285,21 +283,20 @@ static int UdpAliasOut(struct libalias *, struct ip *, int, int create); > static int TcpAliasIn(struct libalias *, struct ip *); > static int TcpAliasOut(struct libalias *, struct ip *, int, int create); > > -static int > -IcmpAliasIn1(struct libalias *la, struct ip *pip) > -{ > - > - LIBALIAS_LOCK_ASSERT(la); > /* > De-alias incoming echo and timestamp replies. > Alias incoming echo and timestamp requests. > */ > +static int > +IcmpAliasIn1(struct libalias *la, struct ip *pip) > +{ > + LIBALIAS_LOCK_ASSERT(la); > struct alias_link *lnk; > struct icmp *ic; And this is not in style. Declarations must precede executable statements, even asserts.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YKAkAcYHXN7XMyoL>