All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15)
@ 2022-01-03  4:55 Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 12/15] scripts: kernel-doc: Transform documentation into POD (12/15) Tomasz Warniełło
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tomasz Warniełło @ 2022-01-03  4:55 UTC (permalink / raw)
  To: corbet; +Cc: Tomasz Warniełło, linux-doc, linux-kernel, Jani Nikula

Step 11) Remove the "format of comments" comment block

As suggested by Jani Nikula in a reply to my first version of this
transformation, Documentation/doc-guide/kernel-doc.rst can serve as the
information hub for comment formatting. The section DESCRIPTION already
points there, so the original comment block can just be removed.

See step 1 for the series details.

= Meta note =

I guess, I should use the Suggested-by tag for credits.
Maintainers, please correct this if I'm doing this wrong.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Tomasz Warniełło <tomasz.warniello@gmail.com>
---
 scripts/kernel-doc | 115 ---------------------------------------------
 1 file changed, 115 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index bf0c5bb7b026..8069d1d29841 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -79,121 +79,6 @@ See Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax.
 # 25/07/2012 - Added support for HTML5
 # -- Dan Luedtke <mail@danrl.de>
 
-#
-# format of comments.
-# In the following table, (...)? signifies optional structure.
-#                         (...)* signifies 0 or more structure elements
-# /**
-#  * function_name(:)? (- short description)?
-# (* @parameterx: (description of parameter x)?)*
-# (* a blank line)?
-#  * (Description:)? (Description of function)?
-#  * (section header: (section description)? )*
-#  (*)?*/
-#
-# So .. the trivial example would be:
-#
-# /**
-#  * my_function
-#  */
-#
-# If the Description: header tag is omitted, then there must be a blank line
-# after the last parameter specification.
-# e.g.
-# /**
-#  * my_function - does my stuff
-#  * @my_arg: its mine damnit
-#  *
-#  * Does my stuff explained.
-#  */
-#
-#  or, could also use:
-# /**
-#  * my_function - does my stuff
-#  * @my_arg: its mine damnit
-#  * Description: Does my stuff explained.
-#  */
-# etc.
-#
-# Besides functions you can also write documentation for structs, unions,
-# enums and typedefs. Instead of the function name you must write the name
-# of the declaration;  the struct/union/enum/typedef must always precede
-# the name. Nesting of declarations is not supported.
-# Use the argument mechanism to document members or constants.
-# e.g.
-# /**
-#  * struct my_struct - short description
-#  * @a: first member
-#  * @b: second member
-#  *
-#  * Longer description
-#  */
-# struct my_struct {
-#     int a;
-#     int b;
-# /* private: */
-#     int c;
-# };
-#
-# All descriptions can be multiline, except the short function description.
-#
-# For really longs structs, you can also describe arguments inside the
-# body of the struct.
-# eg.
-# /**
-#  * struct my_struct - short description
-#  * @a: first member
-#  * @b: second member
-#  *
-#  * Longer description
-#  */
-# struct my_struct {
-#     int a;
-#     int b;
-#     /**
-#      * @c: This is longer description of C
-#      *
-#      * You can use paragraphs to describe arguments
-#      * using this method.
-#      */
-#     int c;
-# };
-#
-# This should be use only for struct/enum members.
-#
-# You can also add additional sections. When documenting kernel functions you
-# should document the "Context:" of the function, e.g. whether the functions
-# can be called form interrupts. Unlike other sections you can end it with an
-# empty line.
-# A non-void function should have a "Return:" section describing the return
-# value(s).
-# Example-sections should contain the string EXAMPLE so that they are marked
-# appropriately in DocBook.
-#
-# Example:
-# /**
-#  * user_function - function that can only be called in user context
-#  * @a: some argument
-#  * Context: !in_interrupt()
-#  *
-#  * Some description
-#  * Example:
-#  *    user_function(22);
-#  */
-# ...
-#
-#
-# All descriptive text is further processed, scanning for the following special
-# patterns, which are highlighted appropriately.
-#
-# 'funcname()' - function
-# '$ENVVAR' - environmental variable
-# '&struct_name' - name of a structure (up to two words including 'struct')
-# '&struct_name.member' - name of a structure member
-# '@parameter' - name of a parameter
-# '%CONST' - name of a constant.
-# '``LITERAL``' - literal string without any spaces on it.
-
 ## init lots of data
 
 my $errors = 0;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 12/15] scripts: kernel-doc: Transform documentation into POD (12/15)
  2022-01-03  4:55 [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15) Tomasz Warniełło
@ 2022-01-03  4:55 ` Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 13/15] scripts: kernel-doc: Transform documentation into POD (13/15) Tomasz Warniełło
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tomasz Warniełło @ 2022-01-03  4:55 UTC (permalink / raw)
  To: corbet; +Cc: Tomasz Warniełło, linux-doc, linux-kernel

Step 12) Archive the pre-git museum

Jonathan Corbet suggested in a reply to my version 1, that these records
can go, since that's what the git log is for. I don't agree.

The log begins at 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2. That's from
2005. One of those entries is indeed logged, so kudos for having me check
this. But not the older ones. Of course they can be found indirectly,
but then...

Why not just let them embellish the script tail?

As you can see, they don't even require any formatting there.

Are you sure you don't want them?

See step 1 for the series details.

Signed-off-by: Tomasz Warniełło <tomasz.warniello@gmail.com>
---
 scripts/kernel-doc | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 8069d1d29841..51e813a84d8b 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -54,31 +54,10 @@ See Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax.
 
 # more perldoc at the end of the file
 
-# 18/01/2001 - 	Cleanups
-# 		Functions prototyped as foo(void) same as foo()
-# 		Stop eval'ing where we don't need to.
-# -- huggie@earth.li
-
-# 27/06/2001 -  Allowed whitespace after initial "/**" and
-#               allowed comments before function declarations.
-# -- Christian Kreibich <ck@whoop.org>
-
 # Still to do:
 # 	- add perldoc documentation
 # 	- Look more closely at some of the scarier bits :)
 
-# 26/05/2001 - 	Support for separate source and object trees.
-#		Return error code.
-# 		Keith Owens <kaos@ocs.com.au>
-
-# 23/09/2001 - Added support for typedefs, structs, enums and unions
-#              Support for Context section; can be terminated using empty line
-#              Small fixes (like spaces vs. \s in regex)
-# -- Tim Jansen <tim@tjansen.de>
-
-# 25/07/2012 - Added support for HTML5
-# -- Dan Luedtke <mail@danrl.de>
-
 ## init lots of data
 
 my $errors = 0;
@@ -2518,3 +2497,25 @@ Treat warnings as errors.
 =back
 
 =cut
+
+PRE-GIT MUSEUM
+
+Original formatting preserved for its historical value.
+
+# 18/01/2001 - 	Cleanups
+# 		Functions prototyped as foo(void) same as foo()
+# 		Stop eval'ing where we don't need to.
+# -- huggie@earth.li
+
+# 27/06/2001 -  Allowed whitespace after initial "/**" and
+#               allowed comments before function declarations.
+# -- Christian Kreibich <ck@whoop.org>
+
+# 26/05/2001 - 	Support for separate source and object trees.
+#		Return error code.
+# 		Keith Owens <kaos@ocs.com.au>
+
+# 23/09/2001 - Added support for typedefs, structs, enums and unions
+#              Support for Context section; can be terminated using empty line
+#              Small fixes (like spaces vs. \s in regex)
+# -- Tim Jansen <tim@tjansen.de>
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 13/15] scripts: kernel-doc: Transform documentation into POD (13/15)
  2022-01-03  4:55 [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15) Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 12/15] scripts: kernel-doc: Transform documentation into POD (12/15) Tomasz Warniełło
@ 2022-01-03  4:55 ` Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 14/15] scripts: kernel-doc: Transform documentation into POD (14/15) Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 15/15] scripts: kernel-doc: Transform documentation into POD (15/15) Tomasz Warniełło
  3 siblings, 0 replies; 5+ messages in thread
From: Tomasz Warniełło @ 2022-01-03  4:55 UTC (permalink / raw)
  To: corbet; +Cc: Tomasz Warniełło, linux-doc, linux-kernel

Step 13) License cleanup

As stated by Jonathan Corbet in the reply to my version 1, the SPDX line is
enough.

See step 1 for the series details.

(Still not sure about this tag line, so please correct if needed.)

Suggested-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Tomasz Warniełło <tomasz.warniello@gmail.com>
---
 scripts/kernel-doc | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 51e813a84d8b..eb56770b96c5 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -12,9 +12,6 @@ use strict;
 ## 								 ##
 ## #define enhancements by Armin Kuster <akuster@mvista.com>	 ##
 ## Copyright (c) 2000 MontaVista Software, Inc.			 ##
-## 								 ##
-## This software falls under the GNU General Public License.     ##
-## Please read the COPYING file for more information             ##
 
 use Pod::Usage qw/pod2usage/;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 14/15] scripts: kernel-doc: Transform documentation into POD (14/15)
  2022-01-03  4:55 [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15) Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 12/15] scripts: kernel-doc: Transform documentation into POD (12/15) Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 13/15] scripts: kernel-doc: Transform documentation into POD (13/15) Tomasz Warniełło
@ 2022-01-03  4:55 ` Tomasz Warniełło
  2022-01-03  4:55 ` [PATCH v2 15/15] scripts: kernel-doc: Transform documentation into POD (15/15) Tomasz Warniełło
  3 siblings, 0 replies; 5+ messages in thread
From: Tomasz Warniełło @ 2022-01-03  4:55 UTC (permalink / raw)
  To: corbet; +Cc: Tomasz Warniełło, linux-doc, linux-kernel

Step 14) Refresh the copyright lines

I'm not sure, why these notices need to stay at the top, but that's what
Jonathat Corbet replied to my version 1.

Anyways, I've cleaned them up a little. Looks good?

My name's included as the refreshing force of this venerable script.

See step 1 for the series details.

(Still not sure about this tag line, so please correct, let me know, etc.)

Suggested-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Tomasz Warniełło <tomasz.warniello@gmail.com>
---
 scripts/kernel-doc | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index eb56770b96c5..c588e7a08c77 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -4,14 +4,16 @@
 use warnings;
 use strict;
 
-## Copyright (c) 1998 Michael Zucchi, All Rights Reserved        ##
-## Copyright (C) 2000, 1  Tim Waugh <twaugh@redhat.com>          ##
-## Copyright (C) 2001  Simon Huggins                             ##
-## Copyright (C) 2005-2012  Randy Dunlap                         ##
-## Copyright (C) 2012  Dan Luedtke                               ##
-## 								 ##
-## #define enhancements by Armin Kuster <akuster@mvista.com>	 ##
-## Copyright (c) 2000 MontaVista Software, Inc.			 ##
+# Copyright (C) 1998 Michael Zucchi, All Rights Reserved
+# Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com>
+# Copyright (C) 2001 Simon Huggins
+# Copyright (C) 2005-2012  Randy Dunlap
+# Copyright (C) 2012 Dan Luedtke
+#
+# #define enhancements by Armin Kuster <akuster@mvista.com>
+# Copyright (C) 2000 MontaVista Software, Inc.
+#
+# Copyright (C) 2022 Tomasz Warniełło (POD)
 
 use Pod::Usage qw/pod2usage/;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 15/15] scripts: kernel-doc: Transform documentation into POD (15/15)
  2022-01-03  4:55 [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15) Tomasz Warniełło
                   ` (2 preceding siblings ...)
  2022-01-03  4:55 ` [PATCH v2 14/15] scripts: kernel-doc: Transform documentation into POD (14/15) Tomasz Warniełło
@ 2022-01-03  4:55 ` Tomasz Warniełło
  3 siblings, 0 replies; 5+ messages in thread
From: Tomasz Warniełło @ 2022-01-03  4:55 UTC (permalink / raw)
  To: corbet; +Cc: Tomasz Warniełło, linux-doc, linux-kernel

Step 15) Move the TODOs

Earlier I thought I could take "add perldoc documentation" off
of this list. Now I think it also means a self-documentation.
And this is not even started.

I'm putting this block by the end, where it can quietly evolve.

See step 1 for the series details.

Signed-off-by: Tomasz Warniełło <tomasz.warniello@gmail.com>
---
 scripts/kernel-doc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index c588e7a08c77..749a1ea3f866 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -53,10 +53,6 @@ See Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax.
 
 # more perldoc at the end of the file
 
-# Still to do:
-# 	- add perldoc documentation
-# 	- Look more closely at some of the scarier bits :)
-
 ## init lots of data
 
 my $errors = 0;
@@ -2497,6 +2493,11 @@ Treat warnings as errors.
 
 =cut
 
+TODO
+
+- add perldoc documentation
+- Look more closely at some of the scarier bits :)
+
 PRE-GIT MUSEUM
 
 Original formatting preserved for its historical value.
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-03  4:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03  4:55 [PATCH v2 11/15] scripts: kernel-doc: Transform documentation into POD (11/15) Tomasz Warniełło
2022-01-03  4:55 ` [PATCH v2 12/15] scripts: kernel-doc: Transform documentation into POD (12/15) Tomasz Warniełło
2022-01-03  4:55 ` [PATCH v2 13/15] scripts: kernel-doc: Transform documentation into POD (13/15) Tomasz Warniełło
2022-01-03  4:55 ` [PATCH v2 14/15] scripts: kernel-doc: Transform documentation into POD (14/15) Tomasz Warniełło
2022-01-03  4:55 ` [PATCH v2 15/15] scripts: kernel-doc: Transform documentation into POD (15/15) Tomasz Warniełło

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.