mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Tamir Duberstein <tamird@gmail.com>
Cc: David Gow <davidgow@google.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>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v8 1/4] scanf: implicate test line in failure messages
Date: Wed, 5 Mar 2025 10:56:01 +0100	[thread overview]
Message-ID: <Z8gfsd5V9wrPKkiA@pathway.suse.cz> (raw)
In-Reply-To: <20250214-scanf-kunit-convert-v8-1-5ea50f95f83c@gmail.com>

On Fri 2025-02-14 11:19:58, Tamir Duberstein wrote:
> This improves the failure output by pointing to the failing line at the
> top level of the test.
> 
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
>  lib/test_scanf.c | 66 ++++++++++++++++++++++++++++----------------------------
>  1 file changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/lib/test_scanf.c b/lib/test_scanf.c
> index 44f8508c9d88..d1664e0d0138 100644
> --- a/lib/test_scanf.c
> +++ b/lib/test_scanf.c
> @@ -24,12 +24,12 @@ static char *test_buffer __initdata;
>  static char *fmt_buffer __initdata;
>  static struct rnd_state rnd_state __initdata;
>  
> -typedef int (*check_fn)(const void *check_data, const char *string,
> -			const char *fmt, int n_args, va_list ap);
> +typedef int (*check_fn)(const char *file, const int line, const void *check_data,
> +			const char *string, const char *fmt, int n_args, va_list ap);
>  
> -static void __scanf(4, 6) __init
> -_test(check_fn fn, const void *check_data, const char *string, const char *fmt,
> -	int n_args, ...)
> +static void __scanf(6, 0) __init

This should be:

static void __scanf(6, 8) __init

The zero (0) is used when the parameters are passed via the va_list.
The value must be the position of the first parameter when they are passed
via the variable list of parameters, aka (...).

Otherwise, it triggers the warnings reported by the lkp@intel.com
kernel test robot, see
https://lore.kernel.org/r/202502160245.KUrryBJR-lkp@intel.com

Best Regards,
Petr

  parent reply	other threads:[~2025-03-05  9:56 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 [this message]
2025-03-05 11:35     ` Tamir Duberstein
2025-02-14 16:19 ` [PATCH v8 2/4] scanf: remove redundant debug logs Tamir Duberstein
2025-03-05  8:59   ` 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=Z8gfsd5V9wrPKkiA@pathway.suse.cz \
    --to=pmladek@suse.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=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=shuah@kernel.org \
    --cc=tamird@gmail.com \
    /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

all inboxes | Powered by JetHome®