linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 11/16] scripts: kernel-doc: validate kernel-doc markup with the actual names
Date: Mon, 18 Jan 2021 13:35:45 -0700	[thread overview]
Message-ID: <20210118133545.05af2277@lwn.net> (raw)
In-Reply-To: <081546f141a496d6cabb99a4adc140444c705e93.1610610937.git.mchehab+huawei@kernel.org>

On Thu, 14 Jan 2021 09:04:47 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:

> Kernel-doc currently expects that the kernel-doc markup to come
> just before the function/enum/struct/union/typedef prototype.
> 
> Yet, if it find things like:
> 
> 	/**
> 	 * refcount_add - add a value to a refcount
> 	 * @i: the value to add to the refcount
> 	 * @r: the refcount
> 	 */
> 	static inline void __refcount_add(int i, refcount_t *r, int *oldp);
> 	static inline void refcount_add(int i, refcount_t *r);
> 
> Kernel-doc will do the wrong thing:
> 
> 	foobar.h:6: warning: Function parameter or member 'oldp' not described in '__refcount_add'
> 	.. c:function:: void __refcount_add (int i, refcount_t *r, int *oldp)
> 
> 	   add a value to a refcount
> 
> 	**Parameters**
> 
> 	``int i``
> 	  the value to add to the refcount
> 
> 	``refcount_t *r``
> 	  the refcount
> 
> 	``int *oldp``
> 	  *undescribed*
> 
> Basically, it will document "__refcount_add" with the kernel-doc
> markup for refcount_add.
> 
> If both functions have the same arguments, this won't even
> produce any warning!
> 
> Add a logic to check if the kernel-doc identifier matches the actual
> name of the C function or data structure that will be documented.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

I've applied this one; it seems useful to have even if it creates more
warnings that Stephen will duly email me about tomorrow...:)  I have parts
1-10 set aside and will apply any that don't get picked up directly by the
maintainers involved.

Thanks,

jon

  parent reply	other threads:[~2021-01-18 20:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  8:04 [PATCH v6 00/16] Fix several bad kernel-doc markups Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 01/16] parport: fix a kernel-doc markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 02/16] rapidio: fix kernel-doc a markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 03/16] fs: fix kernel-doc markups Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 04/16] pstore/zone: fix a kernel-doc markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 05/16] firmware: stratix10-svc: fix kernel-doc markups Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 06/16] connector: fix a kernel-doc markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 07/16] lib/crc7: " Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 08/16] memblock: fix kernel-doc markups Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 09/16] w1: fix a kernel-doc markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 10/16] selftests: kselftest_harness.h: partially fix kernel-doc markups Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 11/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
2021-01-14 10:11   ` kernel test robot
2021-01-14 10:16   ` kernel test robot
2021-01-18 20:35   ` Jonathan Corbet [this message]
2021-01-19  7:43     ` Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 12/16] net: tip: fix a couple kernel-doc markups Mauro Carvalho Chehab
2021-01-14 15:59   ` Jon Maloy
2021-01-14 18:34     ` Jakub Kicinski
2021-01-14 21:22       ` Johannes Berg
2021-01-14  8:04 ` [PATCH v6 13/16] net: cfg80211: fix a kerneldoc markup Mauro Carvalho Chehab
2021-01-14  8:04 ` [PATCH v6 14/16] reset: core: fix a kernel-doc markup Mauro Carvalho Chehab
2021-01-14  8:25   ` Philipp Zabel
2021-01-14  8:04 ` [PATCH v6 15/16] drm: drm_crc: " Mauro Carvalho Chehab
2021-01-14  8:06   ` Simon Ser
2021-01-14 14:13     ` Simon Ser
2021-01-14  8:04 ` [PATCH v6 16/16] platform/surface: aggregator: " Mauro Carvalho Chehab
2021-01-14 14:53   ` Maximilian Luz
2021-01-18 18:20   ` Hans de Goede
2021-01-21 19:09 ` [PATCH v6 00/16] Fix several bad kernel-doc markups Jonathan Corbet

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=20210118133545.05af2277@lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /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).