Hi Tamir,

On Mon, 10 Feb 2025 at 16:00, Tamir Duberstein <tam...@gmail.com> wrote:
> Use `suite_init` and move some tests into `scanf_test_cases`. This
> gives us nicer output in the event of a failure.
>
> Reviewed-by: David Gow <david...@google.com>
> Signed-off-by: Tamir Duberstein <tam...@gmail.com>

Thanks for your patch!

> --- a/lib/scanf_kunit.c
> +++ b/lib/scanf_kunit.c
> @@ -4,19 +4,14 @@
>   */
>
>  #include <kunit/test.h>
> -#include <linux/bitops.h>
> -#include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/overflow.h>
> -#include <linux/printk.h>
>  #include <linux/prandom.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> +#include <linux/sprintf.h>
>
>  #define BUF_SIZE 1024
>
> -static char *test_buffer;
> -static char *fmt_buffer;
> +static char test_buffer[BUF_SIZE];
> +static char fmt_buffer[BUF_SIZE];

Why? This wastes 2 KiB of memory when the test is not running.

>  static struct rnd_state rnd_state;
>
>  typedef void (*check_fn)(struct kunit *test, const void *check_data, const 
> char *string,

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Reply via email to