netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Serhey Popovych <serhe.popovych@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 0/3] ip/tunnel: Unify tunnel help message print routines
Date: Thu, 8 Feb 2018 20:52:52 -0700	[thread overview]
Message-ID: <be7b4202-e4a1-952a-c47a-75761f14fb0d@gmail.com> (raw)
In-Reply-To: <1ff86254-bed1-00df-7037-39df0d9471f4@gmail.com>

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 <help|garbage>" 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 <kind>" 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?

  reply	other threads:[~2018-02-09  3:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 10:50 [PATCH iproute2-next 0/3] ip/tunnel: Unify tunnel help message print routines Serhey Popovych
2018-02-08 10:50 ` [PATCH iproute2-next 1/3] vti/vti6: Unify vti_print_help() Serhey Popovych
2018-02-08 10:50 ` [PATCH iproute2-next 2/3] gre/gre6: Unify gre_print_help() Serhey Popovych
2018-02-08 10:50 ` [PATCH iproute2-next 3/3] iptnl/ip6tnl: Unify iptunnel_print_help() Serhey Popovych
2018-02-09  3:35 ` [PATCH iproute2-next 0/3] ip/tunnel: Unify tunnel help message print routines David Ahern
2018-02-09  3:52   ` David Ahern [this message]
2018-02-09  6:48     ` Serhey Popovych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be7b4202-e4a1-952a-c47a-75761f14fb0d@gmail.com \
    --to=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=serhe.popovych@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).