From: Tamir Duberstein <tamird@gmail.com>
To: David Gow <davidgow@google.com>, Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Tamir Duberstein <tamird@gmail.com>
Subject: [PATCH v8 2/4] scanf: remove redundant debug logs
Date: Fri, 14 Feb 2025 11:19:59 -0500 [thread overview]
Message-ID: <20250214-scanf-kunit-convert-v8-2-5ea50f95f83c@gmail.com> (raw)
In-Reply-To: <20250214-scanf-kunit-convert-v8-0-5ea50f95f83c@gmail.com>
Remove `pr_debug` calls which emit information already contained in
`pr_warn` calls that occur on test failure. This reduces unhelpful test
verbosity.
Note that a `pr_debug` removed from `_check_numbers_template` appears to
have been the only guard against silent false positives, but in fact
this condition is handled in `_test`; it is only possible for `n_args`
to be `0` in `_check_numbers_template` if the test explicitly expects it
*and* `vsscanf` returns `0`, matching the expectation.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
lib/test_scanf.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/test_scanf.c b/lib/test_scanf.c
index d1664e0d0138..efdde6f498d9 100644
--- a/lib/test_scanf.c
+++ b/lib/test_scanf.c
@@ -62,10 +62,8 @@ _test(const char *file, const int line, check_fn fn, const void *check_data, con
#define _check_numbers_template(arg_fmt, expect, str, fmt, n_args, ap) \
do { \
- pr_debug("\"%s\", \"%s\" ->\n", str, fmt); \
for (; n_args > 0; n_args--, expect++) { \
typeof(*expect) got = *va_arg(ap, typeof(expect)); \
- pr_debug("\t" arg_fmt "\n", got); \
if (got != *expect) { \
pr_warn("%s:%d, vsscanf(\"%s\", \"%s\", ...) expected " arg_fmt " got " arg_fmt "\n", \
file, line, str, fmt, *expect, got); \
@@ -689,7 +687,6 @@ do { \
total_tests++; \
len = snprintf(test_buffer, BUF_SIZE, gen_fmt, expect); \
got = (fn)(test_buffer, &endp, base); \
- pr_debug(#fn "(\"%s\", %d) -> " gen_fmt "\n", test_buffer, base, got); \
if (got != (expect)) { \
fail = true; \
pr_warn(#fn "(\"%s\", %d): got " gen_fmt " expected " gen_fmt "\n", \
--
2.48.1
next prev parent reply other threads:[~2025-02-14 16:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 16:19 [PATCH v8 0/4] scanf: convert self-test to KUnit Tamir Duberstein
2025-02-14 16:19 ` [PATCH v8 1/4] scanf: implicate test line in failure messages Tamir Duberstein
2025-03-05 8:55 ` Petr Mladek
2025-03-05 9:56 ` Petr Mladek
2025-03-05 11:35 ` Tamir Duberstein
2025-02-14 16:19 ` Tamir Duberstein [this message]
2025-03-05 8:59 ` [PATCH v8 2/4] scanf: remove redundant debug logs Petr Mladek
2025-02-14 16:20 ` [PATCH v8 3/4] scanf: convert self-test to KUnit Tamir Duberstein
2025-02-15 18:50 ` kernel test robot
[not found] ` <CAJ-ks9kkigKG=Nf_mZrA5CA=SUV2sSyY51_rLef42T+ZxCmk1Q@mail.gmail.com>
2025-02-16 20:22 ` Andy Shevchenko
2025-02-17 14:29 ` Tamir Duberstein
2025-03-05 9:47 ` Petr Mladek
2025-03-05 11:36 ` Tamir Duberstein
2025-03-05 12:46 ` Petr Mladek
2025-02-14 16:20 ` [PATCH v8 4/4] scanf: break kunit into test cases Tamir Duberstein
2025-03-05 15:01 ` Petr Mladek
2025-03-05 15:25 ` Tamir Duberstein
2025-03-05 15:55 ` Andy Shevchenko
2025-03-05 15:57 ` Tamir Duberstein
2025-03-05 19:35 ` Andy Shevchenko
2025-03-05 20:09 ` Tamir Duberstein
2025-03-06 9:38 ` Petr Mladek
2025-03-06 10:56 ` Tamir Duberstein
2025-03-05 15:54 ` Andy Shevchenko
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=20250214-scanf-kunit-convert-v8-2-5ea50f95f83c@gmail.com \
--to=tamird@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davidgow@google.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).