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: <20250214-scanf-kunit-convert-v8-2-5ea50f95f83c@gmail.com>
Date: Fri, 14 Feb 2025 11:19:59 -0500
From: Tamir Duberstein <tamird@...il.com>
To: David Gow <davidgow@...gle.com>, Petr Mladek <pmladek@...e.com>, 
 Steven Rostedt <rostedt@...dmis.org>, 
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
 Rasmus Villemoes <linux@...musvillemoes.dk>, 
 Sergey Senozhatsky <senozhatsky@...omium.org>, 
 Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>, linux-kernel@...r.kernel.org, 
 linux-kselftest@...r.kernel.org, Tamir Duberstein <tamird@...il.com>
Subject: [PATCH v8 2/4] scanf: remove redundant debug logs

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@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ