From owner-dev-commits-src-main@freebsd.org Sat May 15 19:42:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8F4564DE2F; Sat, 15 May 2021 19:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FjG4c3pgpz3hF8; Sat, 15 May 2021 19:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 14FJfrDd040099 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 15 May 2021 22:41:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 14FJfrDd040099 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 14FJfrd9040098; Sat, 15 May 2021 22:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 15 May 2021 22:41:53 +0300 From: Konstantin Belousov To: Lutz Donnerhacke 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: References: <202105150701.14F717lf084359@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202105150701.14F717lf084359@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FjG4c3pgpz3hF8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2021 19:42:08 -0000 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 > AuthorDate: 2021-05-14 13:08:08 +0000 > Commit: Lutz Donnerhacke > 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.