[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9kXetd0wfy44T0g2r6Jx5eKSXr6N8Zk8wpAWj=5SKwHog@mail.gmail.com>
Date: Wed, 5 Mar 2025 06:35:01 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: David Gow <davidgow@...gle.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>,
Geert Uytterhoeven <geert@...ux-m68k.org>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v8 1/4] scanf: implicate test line in failure messages
On Wed, Mar 5, 2025 at 4:56 AM Petr Mladek <pmladek@...e.com> wrote:
>
> 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@...il.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@...el.com
> kernel test robot, see
> https://lore.kernel.org/r/202502160245.KUrryBJR-lkp@intel.com
>
> Best Regards,
> Petr
Thanks for explaining!
Powered by blists - more mailing lists