[LTP] [PATCH 3/4] include: Fix kernel-doc warnings in header comments

Petr Vorel pvorel@suse.cz
Mon Jun 1 16:09:01 CEST 2026


Hi Andrea,

> Drop :ref: cross-references to undocumented structs in tst_test.h
> and tst_kvercmp.h kernel-doc comments, replacing them with plain
> text. These produced 'undefined label' Sphinx warnings.

+1, that goes under me I guess. I checked that at the time, but I did not get it
would work without :ref:.

Fixes: b7df4320b0 ("tst_test.h: Link various structs in sphinx doc")
Fixes: 597613727a ("doc: Convert tst_kvercmp.h to RST")
Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Downgrade kernel-doc comments to plain comments for struct tst_cmd
> and TST_CAP() macro to avoid name collisions with the tst_cmd()
> function and struct tst_cap respectively. The kernel-doc parser
> flattens names case-insensitively, causing 'name used several times'
> errors and duplicate target warnings.

Hm ...

...
> +++ b/include/tst_capability.h
> @@ -67,7 +67,7 @@ struct tst_cap {
>  	char *name;
>  };

> -/**
> +/*
>   * TST_CAP() - Create a struct tst_cap entry.

This is the only warning I'd prefer to stay unfixed (i.e. it was kept in the
docs). I wonder if we shouldn't jus rename struct or macro. Because TST_CAP()
should be documented. Cyril @WDYT?

>   *
>   * @action: What should we do, i.e. drop or add capability.
> diff --git a/include/tst_cmd.h b/include/tst_cmd.h
> index 831cb4da486881f9ef345b9f6ead461feb5dfd46..77fbbbc867b6edf841c5347ac612569a5b8470d1 100644
> --- a/include/tst_cmd.h
> +++ b/include/tst_cmd.h
> @@ -19,7 +19,7 @@ enum tst_cmd_flags {
>  	TST_CMD_TCONF_ON_MISSING = 2,
>  };

> -/**
> +/*
>   * struct tst_cmd - Provides details about a command struct needed by LTP test.
>   * @cmd: The name of the command.
>   * @optional: A flag indicating if the command is optional.
> diff --git a/include/tst_kvercmp.h b/include/tst_kvercmp.h
> index 7c991c746a3ab5383535b545c3025f2174d7722b..8457f7926da2022a9fcd215c9404e5cd7f566e0b 100644
> --- a/include/tst_kvercmp.h
> +++ b/include/tst_kvercmp.h
> @@ -93,7 +93,7 @@ struct tst_kern_exv {
>   * @r1: Major kernel version.
>   * @r2: Minor kernel version.
>   * @r3: Kernel patch level.
> - * @vers: A {} terminated array of :ref:`struct tst_kern_exv`.
> + * @vers: A {} terminated array of struct tst_kern_exv.

And ok, C sources and headers should not use :ref:, thanks for fixing it.

Kind regards,
Petr


More information about the ltp mailing list