summaryrefslogtreecommitdiffstats
path: root/Documentation/doc-guide
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-02-16 08:48:17 -0500
committerJonathan Corbet <corbet@lwn.net>2018-02-18 18:54:56 -0500
commitd2253a45576bfb08a13ee39d31980ce4a46394cd (patch)
treef2af0e62417d6b1313622ed86c9df84823edc192 /Documentation/doc-guide
parent6e96788bd8d90bb66f65264e01be7ec7abd36215 (diff)
doc-guide: kernel-doc: move in-line section to be after nested struct
We want to give some examples about how to do in-line comments for nested structs. So, move it to be after nested structs/unions chapter. The section content was not changed on this patch. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/doc-guide')
-rw-r--r--Documentation/doc-guide/kernel-doc.rst56
1 files changed, 28 insertions, 28 deletions
diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst
index 3c00ce0c84e5..1ddfe35c0e78 100644
--- a/Documentation/doc-guide/kernel-doc.rst
+++ b/Documentation/doc-guide/kernel-doc.rst
@@ -211,34 +211,6 @@ Example::
211 int d; 211 int d;
212 }; 212 };
213 213
214In-line member documentation comments
215~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216
217The structure members may also be documented in-line within the definition.
218There are two styles, single-line comments where both the opening ``/**`` and
219closing ``*/`` are on the same line, and multi-line comments where they are each
220on a line of their own, like all other kernel-doc comments::
221
222 /**
223 * struct foo - Brief description.
224 * @foo: The Foo member.
225 */
226 struct foo {
227 int foo;
228 /**
229 * @bar: The Bar member.
230 */
231 int bar;
232 /**
233 * @baz: The Baz member.
234 *
235 * Here, the member description may contain several paragraphs.
236 */
237 int baz;
238 /** @foobar: Single line description. */
239 int foobar;
240 };
241
242Nested structs/unions 214Nested structs/unions
243~~~~~~~~~~~~~~~~~~~~~ 215~~~~~~~~~~~~~~~~~~~~~
244 216
@@ -290,6 +262,34 @@ It is possible to document nested structs and unions, like::
290 #) When the nested struct/union is anonymous, the member ``bar`` in it 262 #) When the nested struct/union is anonymous, the member ``bar`` in it
291 should be documented as ``@bar:`` 263 should be documented as ``@bar:``
292 264
265In-line member documentation comments
266~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267
268The structure members may also be documented in-line within the definition.
269There are two styles, single-line comments where both the opening ``/**`` and
270closing ``*/`` are on the same line, and multi-line comments where they are each
271on a line of their own, like all other kernel-doc comments::
272
273 /**
274 * struct foo - Brief description.
275 * @foo: The Foo member.
276 */
277 struct foo {
278 int foo;
279 /**
280 * @bar: The Bar member.
281 */
282 int bar;
283 /**
284 * @baz: The Baz member.
285 *
286 * Here, the member description may contain several paragraphs.
287 */
288 int baz;
289 /** @foobar: Single line description. */
290 int foobar;
291 };
292
293Typedef documentation 293Typedef documentation
294--------------------- 294---------------------
295 295