mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Docbook: allow warning on unused documentation
Date: Thu, 26 Aug 2010 09:37:10 -0700	[thread overview]
Message-ID: <20100826093710.111b103e.rdunlap@xenotime.net> (raw)
In-Reply-To: <1282136967.13315.1.camel@jlt3.sipsolutions.net>

On Wed, 18 Aug 2010 15:09:27 +0200 Johannes Berg wrote:

> When you don't use !E or !I but only !F, then
> it's very easy to miss including some functions,
> structs etc. in documentation. To help finding
> which ones were missed, allow printing out the
> unused ones as warnings.

How do I test this?  Do I need to add !A to some source file?

> For example, using this on mac80211 yields a
> lot of warnings like this:
> 
>   Warning: didn't use docs for DOC: mac80211 workqueue
>   Warning: didn't use docs for ieee80211_max_queues
>   Warning: didn't use docs for ieee80211_bss_change
>   Warning: didn't use docs for ieee80211_bss_conf
> 
> when generating the documentation for it.

> ---
>  Documentation/kernel-doc-nano-HOWTO.txt |    5 +
>  scripts/basic/docproc.c                 |  130 +++++++++++++++++++++++++++++++-
>  scripts/kernel-doc                      |   52 ++++++++++++
>  3 files changed, 184 insertions(+), 3 deletions(-)
> 
> --- wireless-testing.orig/Documentation/kernel-doc-nano-HOWTO.txt	2010-08-18 14:54:25.000000000 +0200
> +++ wireless-testing/Documentation/kernel-doc-nano-HOWTO.txt	2010-08-18 14:57:12.000000000 +0200
> @@ -345,5 +345,10 @@ documentation, in <filename>, for the fu
>  section titled <section title> from <filename>.
>  Spaces are allowed in <section title>; do not quote the <section title>.
>  
> +!A<filename> is replaced by nothing, but makes the tools verify that
> +all DOC: sections and documented functions, symbols, etc. are used.
> +This makes sense to use when you use !F/!P only and want to verify
> +that all documentation is included.
> +
>  Tim.
>  */ <twaugh@redhat.com>
> --- wireless-testing.orig/scripts/basic/docproc.c	2010-08-18 14:54:26.000000000 +0200
> +++ wireless-testing/scripts/basic/docproc.c	2010-08-18 14:56:27.000000000 +0200
> @@ -34,12 +34,14 @@
>   *
>   */
>  
> +#define _GNU_SOURCE

Can you explain why that is needed?  (curious)

>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <ctype.h>
>  #include <unistd.h>
>  #include <limits.h>
> +#include <errno.h>
>  #include <sys/types.h>
>  #include <sys/wait.h>

> @@ -315,6 +346,85 @@ static void docsect(char *filename, char
>  	exec_kernel_doc(vec);
>  }
>  
> +static void find_all_symbols(char *filename)
> +{
> +	char *vec[4]; /* kerneldoc -docbook -function "section" file NULL */

incorrect comment??

> +	pid_t pid;
> +	int ret, i, count, start;
> +	char real_filename[PATH_MAX + 1];
> +	int pipefd[2];
> +	char *data, *str;
> +	size_t data_len = 0;
> +
> +	vec[0] = KERNELDOC;
> +	vec[1] = LIST;
> +	vec[2] = filename;
> +	vec[3] = NULL;


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2010-08-26 16:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 13:09 Johannes Berg
2010-08-26 16:37 ` Randy Dunlap [this message]
2010-08-26 16:51   ` Johannes Berg
2010-08-26 17:11     ` Randy Dunlap
2010-08-26 17:36       ` Johannes Berg
2010-08-26 17:43       ` [PATCH] " Johannes Berg
2010-08-26 18:48         ` Randy Dunlap

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=20100826093710.111b103e.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®