Skip to contentSkip to conversation

doc: Document the new inline struct member kernel-doc style

PATCH In review Daniel Vetter 3 participants 6 messages Nov 17, 2016 – Nov 19, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: Document the new inline struct member kernel-doc style

We don't just need better doc toolchains, we also need better docs for our doc toolchain!

Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/kernel-documentation.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/kernel-documentation.rst +6 -1
index 10cc7ddb6235..a5bd12d8bd4e 100644
@@ -484,7 +484,10 @@ span multiple lines. The continuation lines may contain indentation.
 In-line member documentation comments
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The structure members may also be documented in-line within the definition::
+The structure members may also be documented in-line within the definition.
+There are two styles, single-line comments where both the opening ``/**`` and
+closing ``*/`` are on the same line, and multi-line comments where they are each
+on a line of their own, like all other kernel-doc comments::
 
   /**
    * struct foo - Brief description.
@@ -502,6 +505,8 @@ The structure members may also be documented in-line within the definition::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
+        /** @foo: Single line description. */
+        int foo;
   }
 
 Private members
Signature · 1 line
2.10.2
#1 lore raw
Quoted 2 lines · Daniel Vetter

We don't just need better doc toolchains, we also need better docs for our doc toolchain!

Mea culpa. Thanks, LGTM.

BR,
Jani.

Quoted 34 lines
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/kernel-documentation.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/kernel-documentation.rst +6 -1
index 10cc7ddb6235..a5bd12d8bd4e 100644
@@ -484,7 +484,10 @@ span multiple lines. The continuation lines may contain indentation.
 In-line member documentation comments
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The structure members may also be documented in-line within the definition::
+The structure members may also be documented in-line within the definition.
+There are two styles, single-line comments where both the opening ``/**`` and
+closing ``*/`` are on the same line, and multi-line comments where they are each
+on a line of their own, like all other kernel-doc comments::
 
   /**
    * struct foo - Brief description.
@@ -502,6 +505,8 @@ The structure members may also be documented in-line within the definition::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
+        /** @foo: Single line description. */
+        int foo;
   }
 
 Private members
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#2 lore raw
Quoted 5 lines · Jani Nikula
Quoted 2 lines · Daniel Vetter

We don't just need better doc toolchains, we also need better docs for our doc toolchain!

Mea culpa. Thanks, LGTM.

Oh, the example struct now has too "foo" fields, documented twice. That's not good.

BR,
Jani.

Quoted 39 lines

BR,
Jani.

Quoted 34 lines
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/kernel-documentation.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/kernel-documentation.rst +6 -1
index 10cc7ddb6235..a5bd12d8bd4e 100644
@@ -484,7 +484,10 @@ span multiple lines. The continuation lines may contain indentation.
 In-line member documentation comments
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The structure members may also be documented in-line within the definition::
+The structure members may also be documented in-line within the definition.
+There are two styles, single-line comments where both the opening ``/**`` and
+closing ``*/`` are on the same line, and multi-line comments where they are each
+on a line of their own, like all other kernel-doc comments::
 
   /**
    * struct foo - Brief description.
@@ -502,6 +505,8 @@ The structure members may also be documented in-line within the definition::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
+        /** @foo: Single line description. */
+        int foo;
   }
 
 Private members
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#3 lore raw

PATCH 1/1 doc: Document the new inline struct member kernel-doc style

In reply to Daniel Vetter

We don't just need better doc toolchains, we also need better docs for our doc toolchain!

v2: Make sure we don't have foo twice (Jani).

Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/kernel-documentation.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/kernel-documentation.rst +6 -1
index 10cc7ddb6235..0dd17069bc0b 100644
@@ -484,7 +484,10 @@ span multiple lines. The continuation lines may contain indentation.
 In-line member documentation comments
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The structure members may also be documented in-line within the definition::
+The structure members may also be documented in-line within the definition.
+There are two styles, single-line comments where both the opening ``/**`` and
+closing ``*/`` are on the same line, and multi-line comments where they are each
+on a line of their own, like all other kernel-doc comments::
 
   /**
    * struct foo - Brief description.
@@ -502,6 +505,8 @@ The structure members may also be documented in-line within the definition::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
+        /** @foobar: Single line description. */
+        int foobar;
   }
 
 Private members
Signature · 1 line
2.10.2
#4 lore raw
Quoted 4 lines · Daniel Vetter

We don't just need better doc toolchains, we also need better docs for our doc toolchain!

v2: Make sure we don't have foo twice (Jani).

Thanks, *now* LGTM. :)

Quoted 35 lines
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/kernel-documentation.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/kernel-documentation.rst +6 -1
index 10cc7ddb6235..0dd17069bc0b 100644
@@ -484,7 +484,10 @@ span multiple lines. The continuation lines may contain indentation.
 In-line member documentation comments
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The structure members may also be documented in-line within the definition::
+The structure members may also be documented in-line within the definition.
+There are two styles, single-line comments where both the opening ``/**`` and
+closing ``*/`` are on the same line, and multi-line comments where they are each
+on a line of their own, like all other kernel-doc comments::
 
   /**
    * struct foo - Brief description.
@@ -502,6 +505,8 @@ The structure members may also be documented in-line within the definition::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
+        /** @foobar: Single line description. */
+        int foobar;
   }
 
 Private members
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center