lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 Sep 2018 15:56:12 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Arseny Maslennikov <ar@...msu.ru>
Cc:     Stephen Hemminger <stephen@...workplumber.org>,
        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 Thu, Sep 06, 2018 at 10:26:56AM +0300, Arseny Maslennikov wrote:
> 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. :)

AFAIK "grep" is the reason.

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



Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ