OSDN Git Service

doc-guide: kernel-doc: add examples about nested union/structs
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 16 Feb 2018 13:48:19 +0000 (11:48 -0200)
committerJonathan Corbet <corbet@lwn.net>
Sun, 18 Feb 2018 23:55:10 +0000 (16:55 -0700)
It helps to give some examples about how to use in-line
comments also when nested union/structs are present. So add it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/doc-guide/kernel-doc.rst

index 1ddfe35..c6c3297 100644 (file)
@@ -286,8 +286,17 @@ on a line of their own, like all other kernel-doc comments::
          * Here, the member description may contain several paragraphs.
          */
         int baz;
-        /** @foobar: Single line description. */
-        int foobar;
+        union {
+                /** @foobar: Single line description. */
+                int foobar;
+        };
+        /** @bar2: Description for struct @bar2 inside @foo */
+        struct {
+                /**
+                 * @bar2.barbar: Description for @barbar inside @foo.bar2
+                 */
+                int barbar;
+        } bar2;
   };
 
 Typedef documentation