From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH iproute2-next 0/3] ip/tunnel: Unify tunnel help message print routines Date: Thu, 8 Feb 2018 20:52:52 -0700 Message-ID: References: <1518087027-1291-1-git-send-email-serhe.popovych@gmail.com> <1ff86254-bed1-00df-7037-39df0d9471f4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Serhey Popovych , netdev@vger.kernel.org Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:35769 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbeBIDwy (ORCPT ); Thu, 8 Feb 2018 22:52:54 -0500 Received: by mail-pg0-f68.google.com with SMTP id o13so2804777pgs.2 for ; Thu, 08 Feb 2018 19:52:54 -0800 (PST) In-Reply-To: <1ff86254-bed1-00df-7037-39df0d9471f4@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2/8/18 8:35 PM, David Ahern wrote: > On 2/8/18 3:50 AM, Serhey Popovych wrote: >> To show only relevant diffs of ip and ipv6 variants help message print >> routines needs to be unified and improved. >> >> 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. >> >> Additionally we get pointer to @struct link_util and can directly access >> ->id information to prepare customized help message. >> >> Split calls to fprintf() two group: one that contains format string with >> 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. >> >> After this series applied following diffs: >> >> # diff -urN ip/link_gre{,6}.c >> # diff -urN ip/link_vti{,6}.c >> # diff -urN ip/link_ip{,6}tnl.c >> >> in scope of help print routines reduced to necessary minimum. >> >> Tested minimally by compiling and executing "ip link help " and >> "ip link add type help" commands. Looks correct. >> >> See individual patch description for more information. > > Series applied to iproute2-next > > I take that back. Before pushing I noticed you dropped the '6' from the name all of the ipv6 print_help functions. Why?