[LTP] [PATCH v2 1/2] lib: Add support for test tags

Li Wang liwang@redhat.com
Wed Oct 23 09:39:19 CEST 2019


Cyril Hrubis <chrubis@suse.cz> wrote:

...
> +static void print_failure_hints(void)
> +{
> +       unsigned int i;
> +       const struct tst_tag *tags = tst_test->tags;
> +
> +       if (!tags)
> +               return;
> +
> +       int hint_printed = 0;
> +       for (i = 0; tags[i].name; i++) {
> +               if (!strcmp(tags[i].name, "linux-git")) {
> +                       if (!hint_printed) {
> +                               hint_printed = 1;
> +                               printf("\n");
> +                               print_colored("HINT: ");
> +                               printf("You _MAY_ be missing kernel fixes,
> see:\n\n");
> +                       }
> +
> +                       printf(LINUX_GIT_URL "%s\n", tags[i].value);
> +               }
> +
> +       }
> +
> +       hint_printed = 0;
> +       for (i = 0; tags[i].name; i++) {
> +               if (!strcmp(tags[i].name, "CVE")) {
>

Maybe we can merge this string compare in the same for loops?

e.g: http://pastebin.test.redhat.com/808028

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191023/fd388af2/attachment-0001.htm>


More information about the ltp mailing list