[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240822101339.GI2164@kernel.org>
Date: Thu, 22 Aug 2024 11:13:39 +0100
From: Simon Horman <horms@...nel.org>
To: Dmitry Safonov <0x7f454c46@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Mohammad Nassiri <mnassiri@...na.com>, netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 2/8] selftests/net: Provide test_snprintf()
helper
On Wed, Aug 21, 2024 at 10:35:10PM +0100, Dmitry Safonov wrote:
> Hi Simon,
>
> On Wed, 21 Aug 2024 at 20:10, Simon Horman <horms@...nel.org> wrote:
> >
> > On Thu, Aug 15, 2024 at 10:32:27PM +0100, Dmitry Safonov via B4 Relay wrote:
> > > From: Dmitry Safonov <0x7f454c46@...il.com>
> > >
> > > Instead of pre-allocating a fixed-sized buffer of TEST_MSG_BUFFER_SIZE
> > > and printing into it, call vsnprintf() with str = NULL, which will
> > > return the needed size of the buffer. This hack is documented in
> > > man 3 vsnprintf.
> > >
> > > Essentially, in C++ terms, it re-invents std::stringstream, which is
> > > going to be used to print different tracing paths and formatted strings.
> > > Use it straight away in __test_print() - which is thread-safe version of
> > > printing in selftests.
> > >
> > > Signed-off-by: Dmitry Safonov <0x7f454c46@...il.com>
> >
> > Hi Dmitry,
> >
> > Some minor nits, as it looks like there will be a v4.
>
> Thanks, both seem reasonable.
> Did you get them with checkpatch.pl or with your trained eyes? :)
>
> These days I run b4 prep --check and on latest version it just gave a
> bunch of fmt-strings with columns > 100.
Hi Dimitry,
For networking code I usually run:
checkpatch.pl --strict --codespell --min-conf-desc-length=80
Where 80 is, I believe, still in line with preferences for Networking code.
Although I'm not entirely sure it is applicable to this patch.
As to your question, in this case I think it is the --strict that causes
checkpatch to flag the issues I raised. Sorry for not mentioning that in my
previous email.
Powered by blists - more mailing lists