From: Stephen Hemminger <shemming@brocade.com>
To: Phil Sutter <phil@nwl.cc>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
David Ahern <dsa@cumulusnetworks.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Julien Floret <julien.floret@6wind.com>, <netdev@vger.kernel.org>
Subject: Re: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit
Date: Tue, 21 Jun 2016 09:53:43 -0700 [thread overview]
Message-ID: <20160621095343.0936eefc@xeon-e3> (raw)
In-Reply-To: <1466525921-15738-8-git-send-email-phil@nwl.cc>
On Tue, 21 Jun 2016 18:18:41 +0200
Phil Sutter <phil@nwl.cc> wrote:
> By combining the attribute extraction and check for existence, the
> additional indentation level in the 'else' clause can be avoided.
>
> In addition to that, common actions for 'daddr' are combined since the
> function returns if neither of the branches are taken.
>
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
> ip/tcp_metrics.c | 45 ++++++++++++++++++---------------------------
> 1 file changed, 18 insertions(+), 27 deletions(-)
>
> diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c
> index f82604f458ada..899830c127bcb 100644
> --- a/ip/tcp_metrics.c
> +++ b/ip/tcp_metrics.c
> @@ -112,47 +112,38 @@ static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
> parse_rtattr(attrs, TCP_METRICS_ATTR_MAX, (void *) ghdr + GENL_HDRLEN,
> len);
>
> - a = attrs[TCP_METRICS_ATTR_ADDR_IPV4];
> - if (a) {
> + if ((a = attrs[TCP_METRICS_ATTR_ADDR_IPV4])) {
NAK, plus it fails checkpatch
next prev parent reply other threads:[~2016-06-21 17:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 16:18 [iproute PATCH v2 0/7] Big C99 style initializer rework Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 1/7] tc: m_action: Improve conversion to C99 style initializers Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 2/7] Use C99 style initializers everywhere Phil Sutter
2016-06-21 16:24 ` David Ahern
2016-06-21 17:03 ` Phil Sutter
2016-06-21 17:13 ` David Ahern
2016-06-21 17:17 ` Phil Sutter
2016-06-21 18:30 ` Stephen Hemminger
2016-06-22 9:12 ` Jakub Sitnicki
2016-06-22 9:29 ` Phil Sutter
2016-06-22 9:41 ` Jakub Sitnicki
2016-06-21 16:18 ` [iproute PATCH v2 3/7] Replace malloc && memset by calloc Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 4/7] No need to initialize rtattr fields before parsing Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 5/7] Makefile: Allow to override CC Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 6/7] misc/ifstat: simplify unsigned value comparison Phil Sutter
2016-06-21 16:18 ` [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit Phil Sutter
2016-06-21 16:29 ` David Laight
2016-06-21 16:53 ` Stephen Hemminger [this message]
2016-06-21 17:07 ` Phil Sutter
2016-06-22 11:34 ` Jakub Sitnicki
2016-06-22 12:55 ` Phil Sutter
2016-06-22 13:00 ` David Laight
2016-06-22 13:08 ` Phil Sutter
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=20160621095343.0936eefc@xeon-e3 \
--to=shemming@brocade.com \
--cc=daniel@iogearbox.net \
--cc=dsa@cumulusnetworks.com \
--cc=julien.floret@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=phil@nwl.cc \
/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).