netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Kees Cook <keescook@chromium.org>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Keith Packard <keithp@keithp.com>,
	nex.sw.ncis.osdt.itp.upstreaming@intel.com,
	linux-doc@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel-doc: fix struct_group_tagged() parsing
Date: Wed, 24 Apr 2024 13:31:14 -0600	[thread overview]
Message-ID: <87r0eusgl9.fsf@meer.lwn.net> (raw)
In-Reply-To: <20240411093208.2483580-1-aleksander.lobakin@intel.com>

Alexander Lobakin <aleksander.lobakin@intel.com> writes:

> From: Kees Cook <keescook@chromium.org>
>
> kernel-doc emits a warning on struct_group_tagged() if you describe your
> struct group member:
>
> include/net/libeth/rx.h:69: warning: Excess struct member 'fp' description in 'libeth_fq'
>
> The code:
>
> /**
>  * struct libeth_fq - structure representing a buffer queue
>  * @fp: hotpath part of the structure
>  * @pp: &page_pool for buffer management
> [...]
>  */
> struct libeth_fq {
> 	struct_group_tagged(libeth_fq_fp, fp,
> 		struct page_pool	*pp;
> [...]
> 	);
>
> When a struct_group_tagged() is encountered, we need to build a
> `struct TAG NAME;` from it, so that it will be treated as a valid
> embedded struct.
> Decouple the regex and do the replacement there. As far as I can see,
> this doesn't produce any new warnings on the current mainline tree.
>
> Reported-by: Jakub Kicinski <kuba@kernel.org>
> Closes: https://lore.kernel.org/netdev/20240405212513.0d189968@kernel.org
> Fixes: 50d7bd38c3aa ("stddef: Introduce struct_group() helper macro")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Co-developed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
>  scripts/kernel-doc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

So, in docs-next, applying this *adds* two warnings:

> ./include/net/page_pool/types.h:77: warning: Function parameter or struct member 'fast' not described in 'page_pool_params'
> ./include/net/page_pool/types.h:77: warning: Function parameter or struct member 'slow' not described in 'page_pool_params'

In truth, the warnings look correct.  I guess I'll leave this applied,
but perhaps a fix for the warnings should go into the net tree?

Thanks,

jon

  parent reply	other threads:[~2024-04-24 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11  9:32 [PATCH] kernel-doc: fix struct_group_tagged() parsing Alexander Lobakin
2024-04-11 11:14 ` Przemek Kitszel
2024-04-11 11:14   ` Alexander Lobakin
2024-04-11 11:48     ` Przemek Kitszel
2024-04-24 19:31 ` Jonathan Corbet [this message]
2024-04-25  9:13   ` Alexander Lobakin

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=87r0eusgl9.fsf@meer.lwn.net \
    --to=corbet@lwn.net \
    --cc=aleksander.lobakin@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=keithp@keithp.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nex.sw.ncis.osdt.itp.upstreaming@intel.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;
as well as URLs for NNTP newsgroup(s).