Re: [PATCH] Docbook: allow warning on unused documentation

Previous thread: [PATCH] power_supply: add isp1704 charger detection driver by Krogerus Heikki (EXT-Teleca/Helsinki) on Wednesday, August 18, 2010 - 6:01 am. (6 messages)

Next thread: [PATCH] init: mark __user address space on string literals by Namhyung Kim on Wednesday, August 18, 2010 - 6:24 am. (1 message)
From: Johannes Berg
Date: Wednesday, August 18, 2010 - 6:09 am

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.

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
 #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>
 
@@ -54,6 +56,7 @@ typedef void FILEONLY(char * file);
 FILEONLY *internalfunctions;
 FILEONLY *externalfunctions;
 FILEONLY ...
From: Randy Dunlap
Date: Thursday, August 26, 2010 - 9:37 am

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

From: Johannes Berg
Date: Thursday, August 26, 2010 - 9:51 am

Yeah, like to Documentation/DocBook/mac80211.tmpl you could add



johannes

--

From: Randy Dunlap
Date: Thursday, August 26, 2010 - 10:11 am

Yes, I see.  That output looks useful.




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

From: Johannes Berg
Date: Thursday, August 26, 2010 - 10:36 am

Sure, I can't say I care much, had "all" in mind when I came up with !A.

I fixed up the command, and can change that and resend.

johannes

--

From: Johannes Berg
Date: Thursday, August 26, 2010 - 10:43 am

From: Johannes Berg <johannes.berg@intel.com>

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.

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.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
v2: - fix comment
    - use !C instead of !A

 Documentation/kernel-doc-nano-HOWTO.txt |    5 +
 scripts/basic/docproc.c                 |  129 +++++++++++++++++++++++++++++++-
 scripts/kernel-doc                      |   52 ++++++++++++
 3 files changed, 183 insertions(+), 3 deletions(-)

--- wireless-testing.orig/Documentation/kernel-doc-nano-HOWTO.txt	2010-08-26 16:00:18.000000000 +0200
+++ wireless-testing/Documentation/kernel-doc-nano-HOWTO.txt	2010-08-26 19:37:36.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>.
 
+!C<filename> is replaced by nothing, but makes the tools check 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-26 16:00:18.000000000 +0200
+++ wireless-testing/scripts/basic/docproc.c	2010-08-26 19:37:17.000000000 +0200
@@ -34,12 +34,14 @@
  *
  */
 
+#define _GNU_SOURCE
 #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>
 ...
From: Randy Dunlap
Date: Thursday, August 26, 2010 - 11:48 am

Applied, thanks.

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

Previous thread: [PATCH] power_supply: add isp1704 charger detection driver by Krogerus Heikki (EXT-Teleca/Helsinki) on Wednesday, August 18, 2010 - 6:01 am. (6 messages)

Next thread: [PATCH] init: mark __user address space on string literals by Namhyung Kim on Wednesday, August 18, 2010 - 6:24 am. (1 message)