All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Josh Hunt <johunt@akamai.com>, David Ahern <dsahern@gmail.com>,
	netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ss: add option to print socket information on one line
Date: Thu, 30 May 2019 11:11:24 +0200	[thread overview]
Message-ID: <86d8b203-69bd-e466-715d-959368685839@web.de> (raw)
In-Reply-To: <1556674718-5081-1-git-send-email-johunt@akamai.com>

This software update caught also my development attention a moment ago.


> +++ b/misc/ss.c
> @@ -3973,7 +3975,10 @@ static int packet_show_sock(struct nlmsghdr *nlh, void *arg)
>
>  	if (show_details) {
>  		if (pinfo) {
> -			out("\n\tver:%d", pinfo->pdi_version);
> +			if (oneline)
> +				out(" ver:%d", pinfo->pdi_version);
> +			else
> +				out("\n\tver:%d", pinfo->pdi_version);
>  			out(" cpy_thresh:%d", pinfo->pdi_copy_thresh);
>  			out(" flags( ");
>  			if (pinfo->pdi_flags & PDI_RUNNING)

I would find it nicer to use the ternary operator here.

+			out(oneline ? " ver:%d" : "\n\tver:%d",
+			    pinfo->pdi_version);


How do you think about to use more succinct statement variants?

Regards,
Markus

  parent reply	other threads:[~2019-05-30  9:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01  1:38 [PATCH v2] ss: add option to print socket information on one line Josh Hunt
2019-05-02 23:11 ` David Ahern
2019-05-30  9:11 ` Markus Elfring [this message]
2019-06-01  8:36 ` ss: Checking efficient analysis for network connections Markus Elfring
2019-06-01 23:48   ` David Miller
2019-06-02  5:40     ` Markus Elfring
2019-06-13 14:40     ` Markus Elfring
2019-07-23  8:25     ` Markus Elfring
2019-09-16 10:32     ` ss: Checking selected network ports Markus Elfring
2019-09-16 10:32       ` Markus Elfring
2019-10-22  6:00     ` [RFC] " Markus Elfring
2019-10-22  6:00       ` Markus Elfring

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=86d8b203-69bd-e466-715d-959368685839@web.de \
    --to=markus.elfring@web.de \
    --cc=dsahern@gmail.com \
    --cc=johunt@akamai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.