summaryrefslogtreecommitdiffstats
path: root/Documentation/doc-guide
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 07:30:05 -0500
committerJonathan Corbet <corbet@lwn.net>2017-12-21 15:41:46 -0500
commit553aa3c12e818a142e493a3d44a1eb8cadc2959f (patch)
tree245dcd4b618f8a8ce8f9dd26d65b5465839e5281 /Documentation/doc-guide
parentfc275bf3b99d2c78e1c132d2199be1cb6a701905 (diff)
docs: kernel-doc.rst: improve structs chapter
There is a mess on this chapter: it suggests that even enums and unions should be documented with "struct". That's not the way it should be ;-) Fix it and move it to happen earlier. 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.rst48
1 files changed, 24 insertions, 24 deletions
diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst
index 3aac228fc346..e3e82f8f4de5 100644
--- a/Documentation/doc-guide/kernel-doc.rst
+++ b/Documentation/doc-guide/kernel-doc.rst
@@ -258,6 +258,30 @@ named ``Return``.
258 as a new section heading, with probably won't produce the desired 258 as a new section heading, with probably won't produce the desired
259 effect. 259 effect.
260 260
261Structure, union, and enumeration documentation
262-----------------------------------------------
263
264The general format of a struct, union, and enum kernel-doc comment is::
265
266 /**
267 * struct struct_name - Brief description.
268 * @argument: Description of member member_name.
269 *
270 * Description of the structure.
271 */
272
273On the above, ``struct`` is used to mean structs. You can also use ``union``
274and ``enum`` to describe unions and enums. ``argument`` is used
275to mean struct and union member names as well as enumerations in an enum.
276
277The brief description following the structure name may span multiple lines, and
278ends with a member description, a blank comment line, or the end of the
279comment block.
280
281The kernel-doc data structure comments describe each member of the structure,
282in order, with the member descriptions.
283
284
261 285
262Highlights and cross-references 286Highlights and cross-references
263------------------------------- 287-------------------------------
@@ -331,30 +355,6 @@ cross-references.
331For further details, please refer to the `Sphinx C Domain`_ documentation. 355For further details, please refer to the `Sphinx C Domain`_ documentation.
332 356
333 357
334Structure, union, and enumeration documentation
335-----------------------------------------------
336
337The general format of a struct, union, and enum kernel-doc comment is::
338
339 /**
340 * struct struct_name - Brief description.
341 * @member_name: Description of member member_name.
342 *
343 * Description of the structure.
344 */
345
346Below, "struct" is used to mean structs, unions and enums, and "member" is used
347to mean struct and union members as well as enumerations in an enum.
348
349The brief description following the structure name may span multiple lines, and
350ends with a ``@member:`` description, a blank comment line, or the end of the
351comment block.
352
353The kernel-doc data structure comments describe each member of the structure, in
354order, with the ``@member:`` descriptions. The ``@member:`` descriptions must
355begin on the very next line following the opening brief function description
356line, with no intervening blank comment lines. The ``@member:`` descriptions may
357span multiple lines. The continuation lines may contain indentation.
358 358
359In-line member documentation comments 359In-line member documentation comments
360~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 360~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~