From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: Re: [PATCH iproute2-next v2 0/3] ip/tunnel: Unify tunnel help message print routines Date: Fri, 9 Feb 2018 09:00:14 +0200 Message-ID: <550674c8-5599-1e59-f1d4-cad87ae7b4ea@gmail.com> References: <1518158702-32604-1-git-send-email-serhe.popovych@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IDunW4niowyOyGi28zW8T4CrPut1K4Nkp" To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:42546 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbeBIHAW (ORCPT ); Fri, 9 Feb 2018 02:00:22 -0500 Received: by mail-lf0-f68.google.com with SMTP id q17so9790182lfa.9 for ; Thu, 08 Feb 2018 23:00:21 -0800 (PST) Received: from tuxracer.as41781.net (6-12-135-95.pool.ukrtel.net. [95.135.12.6]) by smtp.gmail.com with ESMTPSA id v3sm296969ljc.43.2018.02.08.23.00.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 23:00:19 -0800 (PST) In-Reply-To: <1518158702-32604-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IDunW4niowyOyGi28zW8T4CrPut1K4Nkp Content-Type: multipart/mixed; boundary="5YLHLMHiaZ6WBDp5cWU8BDup6Jy25SSTJ"; protected-headers="v1" From: Serhey Popovych To: netdev@vger.kernel.org Message-ID: <550674c8-5599-1e59-f1d4-cad87ae7b4ea@gmail.com> Subject: Re: [PATCH iproute2-next v2 0/3] ip/tunnel: Unify tunnel help message print routines References: <1518158702-32604-1-git-send-email-serhe.popovych@gmail.com> In-Reply-To: <1518158702-32604-1-git-send-email-serhe.popovych@gmail.com> --5YLHLMHiaZ6WBDp5cWU8BDup6Jy25SSTJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > To show only relevant diffs of ip and ipv6 variants help message print > routines needs to be unified and improved. >=20 > Get rid of print_usage() and usage() wrappers: use single function to > output help message. As side effect we return -1 from parse function > instead of calling exit(2) in case of "... tunnel " is > found. >=20 > Additionally we get pointer to @struct link_util and can directly acces= s > ->id information to prepare customized help message. >=20 > Split calls to fprintf() two group: one that contains format string wit= h > specifiers (thus requiring parameters) and another one that does not. > This helps compiler to optimize calls to fprintf() with fputs() when no= > format specifiers in string. Do not use fputs() directly to keep code > formatting nice. >=20 > After this series applied following diffs: >=20 > # diff -urN ip/link_gre{,6}.c > # diff -urN ip/link_vti{,6}.c > # diff -urN ip/link_ip{,6}tnl.c >=20 > in scope of help print routines reduced to necessary minimum. >=20 > Tested minimally by compiling and executing "ip link help " and > "ip link add type help" commands. Looks correct. >=20 > See individual patch description for more information. >=20 > Reviews, commands and suggestions are welcome. >=20 > v2 > Dropped function prefix changes from the series: this is not strictly= > relared change and should be done separately. There is v3 available, we have checkpatch and commit description problems here. >=20 > Thanks, > Serhii >=20 > Serhey Popovych (3): > vti/vti6: Unify vti_print_help() > gre/gre6: Unify gre_print_help() > iptnl/ip6tnl: Unify iptunnel_print_help() >=20 > ip/link_gre.c | 73 ++++++++++++++++++++------------------------ > ip/link_gre6.c | 74 +++++++++++++++++++++------------------------ > ip/link_ip6tnl.c | 45 ++++++++++++++-------------- > ip/link_iptnl.c | 88 ++++++++++++++++++++++++++--------------------= -------- > ip/link_vti.c | 42 +++++++++++--------------- > ip/link_vti6.c | 33 +++++++++----------- > 6 files changed, 165 insertions(+), 190 deletions(-) >=20 --5YLHLMHiaZ6WBDp5cWU8BDup6Jy25SSTJ-- --IDunW4niowyOyGi28zW8T4CrPut1K4Nkp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJafUcCAAoJEBTawMmQ61bB9+EH/0Ol90fENNn2eIKVAXi29/Zo WAF9g8Hd9FKuI1UmQcRcMpIq1W3JW8dSYu/KDaZYbYvrkScKRLn9JHN2p33v7cYI HPBimTrbu0PTFMsI9d4eJntWpSAtnRnSmwN5OQCTonTL8NzIOgU4F91Kxmcx9BLk vrhqCp6yyWjkPEsFqBzQ/4A8F8TRKxbt5irSvm1kLrkVejBNe7TFFf1PMInMDDbV 2MCLogwR2gDag9J7G+T5Y9dVjfyOENuwZKtiNy8mcP7VK8AtNalAiy55qSWD9FJ4 1F73EJm3mQzsVJvcEYl1MVLhvPINq9HINIu6HTgsMBfl/vH54+nyK7tOwqwdyxs= =BJwL -----END PGP SIGNATURE----- --IDunW4niowyOyGi28zW8T4CrPut1K4Nkp--