All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	Mohammad Nassiri <mnassiri@ciena.com>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/8] selftests/net: Provide test_snprintf() helper
Date: Thu, 22 Aug 2024 11:13:39 +0100	[thread overview]
Message-ID: <20240822101339.GI2164@kernel.org> (raw)
In-Reply-To: <CAJwJo6Zix_bkE38RmDW6ywojvmzeOuPVtwH+Jqqz6AT=6jmh5A@mail.gmail.com>

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@kernel.org> wrote:
> >
> > On Thu, Aug 15, 2024 at 10:32:27PM +0100, Dmitry Safonov via B4 Relay wrote:
> > > From: Dmitry Safonov <0x7f454c46@gmail.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@gmail.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.

  reply	other threads:[~2024-08-22 10:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 21:32 [PATCH net-next v3 0/8] net/selftests: TCP-AO selftests updates Dmitry Safonov
2024-08-15 21:32 ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 1/8] selftests/net: Clean-up double assignment Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 2/8] selftests/net: Provide test_snprintf() helper Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-21 19:10   ` Simon Horman
2024-08-21 21:35     ` Dmitry Safonov
2024-08-22 10:13       ` Simon Horman [this message]
2024-08-23 14:27         ` Dmitry Safonov
2024-08-15 21:32 ` [PATCH net-next v3 3/8] selftests/net: Be consistent in kconfig checks Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 4/8] selftests/net: Open /proc/thread-self in open_netns() Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-21 19:11   ` Simon Horman
2024-08-21 21:44     ` Dmitry Safonov
2024-08-22 10:14       ` Simon Horman
2024-08-15 21:32 ` [PATCH net-next v3 5/8] selftests/net: Don't forget to close nsfd after switch_save_ns() Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 6/8] selftests/tcp_ao: Fix printing format for uint64_t Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 7/8] selftests/net: Synchronize client/server before counters checks Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-15 21:32 ` [PATCH net-next v3 8/8] selftests/net: Add trace events matching to tcp_ao Dmitry Safonov
2024-08-15 21:32   ` Dmitry Safonov via B4 Relay
2024-08-19 17:19 ` [PATCH net-next v3 0/8] net/selftests: TCP-AO selftests updates Dmitry Safonov

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=20240822101339.GI2164@kernel.org \
    --to=horms@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mnassiri@ciena.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.