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]
Message-ID: <1c86e75bb56693bc2343d30e5baba09c783b02a2.camel@perches.com>
Date:   Fri, 01 May 2020 17:30:19 -0700
From:   Joe Perches <joe@...ches.com>
To:     Jacob Keller <jacob.e.keller@...el.com>,
        linux-kernel@...r.kernel.org
Cc:     Jakub Kicinski <kuba@...nel.org>,
        Andy Whitcroft <apw@...onical.com>
Subject: Re: [PATCH] checkpatch: add NL_SET_ERR_MSG to 80 column exceptions

On Fri, 2020-05-01 at 17:19 -0700, Jacob Keller wrote:
> 
> On 5/1/2020 4:42 PM, Joe Perches wrote:
> > On Fri, 2020-05-01 at 16:11 -0700, Jacob Keller wrote:
> > > NL_SET_ERR_MSG and NL_SET_ERR_MSG_MOD are used to report extended error
> > > responses about failure of a netlink command. These strings often end up
> > > going over the 80-column limit. Just like logging messages, it is
> > > preferred to leave the message all on a single line.
> > > 
> > > Add these to the exception list so that checkpatch.pl will no longer
> > > complain about the long lines due to use of these macros.
> > > 
> > > Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
> > > Cc: Jakub Kicinski <kuba@...nel.org>
> > > Cc: Andy Whitcroft <apw@...onical.com>
> > > Cc: Joe Perches <joe@...ches.com>
> > > ---
> > >  scripts/checkpatch.pl | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index eac40f0abd56..5da3b06fbeaa 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -471,7 +471,8 @@ our $logFunctions = qr{(?x:
> > >  	WARN(?:_RATELIMIT|_ONCE|)|
> > >  	panic|
> > >  	MODULE_[A-Z_]+|
> > > -	seq_vprintf|seq_printf|seq_puts
> > > +	seq_vprintf|seq_printf|seq_puts|
> > > +	NL_SET_ERR_MSG(?:_MOD)?
> > >  )};
> > >  
> > >  our $allocFunctions = qr{(?x:
> > 
> > <shrug>  OK I guess.
> > 
> > What about GENL_SET_ERR_MSG ?
> > 
> 
> This appears in far fewer locations, but it does seem reasonable to add
> it to this list as well.
> 
> > btw:
> > 
> > There are some uses with what appear to be unnecessary newlines.
> > Maybe these newlines should be removed.
> 
> Yea, there's a number of places which seem to have put a newline break
> after the extack pointer.
> 
> A quick search shows that there are about 970 or so uses where we don't
> put a newline, and around 220 where we do.
> 
> I suppose I can make a series that cleans all of those up along with
> this patch.

That's not what I meant.
I don't care if there are multiple source lines used.
In fact, I think it's mostly nicer with multiple lines.

The ones I specified previously use:

	NL_SET_ERR_MSG_MOD(extack, "message\n");

where all the others uses are:

	NL_SET_ERR_MSG_MOD(extack, "message");

without the \n termination of the message.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ