[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180906072656.GB13034@cello>
Date: Thu, 6 Sep 2018 10:26:56 +0300
From: Arseny Maslennikov <ar@...msu.ru>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: linux-rdma@...r.kernel.org, Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>, netdev@...r.kernel.org
Subject: Re: [PATCH v3 3/3] IB/ipoib: Log sysfs 'dev_id' accesses from
userspace
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@...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...
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists