public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Arseny Maslennikov <ar@cs.msu.ru>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3 3/3] IB/ipoib: Log sysfs 'dev_id' accesses from userspace
Date: Thu, 6 Sep 2018 10:26:56 +0300	[thread overview]
Message-ID: <20180906072656.GB13034@cello> (raw)
In-Reply-To: <20180905164727.3108bce6@shemminger-XPS-13-9360>

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

On Wed, Sep 05, 2018 at 04:47:27PM +0100, Stephen Hemminger wrote:
> On Mon,  3 Sep 2018 19:13:16 +0300
> Arseny Maslennikov <ar@cs.msu.ru> wrote:
> 
> > +	if (ndev->dev_id == ndev->dev_port) {
> > +		netdev_info_once(ndev,
> > +			"\"%s\" wants to know my dev_id. "
> > +			"Should it look at dev_port instead?\n",
> > +			current->comm);
> > +		netdev_info_once(ndev,
> > +			"See Documentation/ABI/testing/sysfs-class-net for more info.\n");
> > +	}
> 
> Single line message is sufficient.
> Also don't break strings in messages.
> 

OK, will fix in v4.


(Sorry if the following is too off-topic here)
Multi-line messages in separate printk calls can be racy, I get that.
But I'd like to hear some reasoning behind the style decision to not
break a long string into many string literals. (I'll most certainly not
be alone in this, Documentation/process/ does not mention reasons, only
the requirements themselves)

The only drawback I currently see is that breaking a long message into
multiple string literals makes it impossible to git grep the kernel tree
for the whole message text.
However, splitting a long line this way allows us to nicely wrap the
code at 80 columns, which is a readability boon.

Are there any other reasons to avoid that? Except maybe matters of taste. :)

> > +	}
> > +
> > +	ret = sprintf(buf, "%#x\n", ndev->dev_id);
> > +
> > +	return ret;
> 
> Why not?
> 	return sprintf...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-09-06  7:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 16:13 [PATCH v3 0/3] IB/ipoib: Use dev_port to disambiguate port numbers Arseny Maslennikov
2018-09-03 16:13 ` [PATCH v3 1/3] Documentation/ABI: document /sys/class/net/*/dev_port Arseny Maslennikov
2018-09-03 16:13 ` [PATCH v3 2/3] IB/ipoib: Use dev_port to expose network interface port numbers Arseny Maslennikov
2018-09-05 13:41   ` Leon Romanovsky
2018-09-03 16:13 ` [PATCH v3 3/3] IB/ipoib: Log sysfs 'dev_id' accesses from userspace Arseny Maslennikov
2018-09-05 13:50   ` Leon Romanovsky
2018-09-06  7:04     ` Arseny Maslennikov
2018-09-06 13:03       ` Leon Romanovsky
2018-09-07 17:14         ` Doug Ledford
2018-09-07 17:28           ` Leon Romanovsky
2018-09-07 20:02             ` Doug Ledford
2018-09-05 15:47   ` Stephen Hemminger
2018-09-06  7:26     ` Arseny Maslennikov [this message]
2018-09-06 12:56       ` Leon Romanovsky

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=20180906072656.GB13034@cello \
    --to=ar@cs.msu.ru \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox