sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget(/translations/zh_CN/doc-guide/kernel-docmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/zh_TW/doc-guide/kernel-docmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/it_IT/doc-guide/kernel-docmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ja_JP/doc-guide/kernel-docmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ko_KR/doc-guide/kernel-docmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/sp_SP/doc-guide/kernel-docmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hWriting kernel-doc commentsh]hWriting kernel-doc comments}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhB/var/lib/git/docbuild/linux/Documentation/doc-guide/kernel-doc.rsthKubh paragraph)}(hThe Linux kernel source files may contain structured documentation comments in the kernel-doc format to describe the functions, types and design of the code. It is easier to keep documentation up-to-date when it is embedded in source files.h]hThe Linux kernel source files may contain structured documentation comments in the kernel-doc format to describe the functions, types and design of the code. It is easier to keep documentation up-to-date when it is embedded in source files.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhnote)}(hThe kernel-doc format is deceptively similar to javadoc, gtk-doc or Doxygen, yet distinctively different, for historical reasons. The kernel source contains tens of thousands of kernel-doc comments. Please stick to the style described here.h]h)}(hThe kernel-doc format is deceptively similar to javadoc, gtk-doc or Doxygen, yet distinctively different, for historical reasons. The kernel source contains tens of thousands of kernel-doc comments. Please stick to the style described here.h]hThe kernel-doc format is deceptively similar to javadoc, gtk-doc or Doxygen, yet distinctively different, for historical reasons. The kernel source contains tens of thousands of kernel-doc comments. Please stick to the style described here.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hckernel-doc does not cover Rust code: please see Documentation/rust/general-information.rst instead.h]h)}(hckernel-doc does not cover Rust code: please see Documentation/rust/general-information.rst instead.h]hckernel-doc does not cover Rust code: please see Documentation/rust/general-information.rst instead.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hXThe kernel-doc structure is extracted from the comments, and proper `Sphinx C Domain`_ function and type descriptions with anchors are generated from them. The descriptions are filtered for special kernel-doc highlights and cross-references. See below for details.h](hDThe kernel-doc structure is extracted from the comments, and proper }(hhhhhNhNubh reference)}(h`Sphinx C Domain`_h]hSphinx C Domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameSphinx C Domainrefuri0http://www.sphinx-doc.org/en/stable/domains.htmluh1jhhresolvedKubh function and type descriptions with anchors are generated from them. The descriptions are filtered for special kernel-doc highlights and cross-references. See below for details.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtarget)}(hE.. _Sphinx C Domain: http://www.sphinx-doc.org/en/stable/domains.htmlh]h}(h]sphinx-c-domainah ]h"]sphinx c domainah$]h&]jjuh1j hKhhhhhh referencedKubh)}(hXEvery function that is exported to loadable modules using ``EXPORT_SYMBOL`` or ``EXPORT_SYMBOL_GPL`` should have a kernel-doc comment. Functions and data structures in header files which are intended to be used by modules should also have kernel-doc comments.h](h:Every function that is exported to loadable modules using }(hj/hhhNhNubhliteral)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj/ubh or }(hj/hhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj/ubh should have a kernel-doc comment. Functions and data structures in header files which are intended to be used by modules should also have kernel-doc comments.}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXIt is good practice to also provide kernel-doc formatted documentation for functions externally visible to other kernel files (not marked ``static``). We also recommend providing kernel-doc formatted documentation for private (file ``static``) routines, for consistency of kernel source code layout. This is lower priority and at the discretion of the maintainer of that kernel source file.h](hIt is good practice to also provide kernel-doc formatted documentation for functions externally visible to other kernel files (not marked }(hjchhhNhNubj8)}(h ``static``h]hstatic}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjcubhT). We also recommend providing kernel-doc formatted documentation for private (file }(hjchhhNhNubj8)}(h ``static``h]hstatic}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjcubh) routines, for consistency of kernel source code layout. This is lower priority and at the discretion of the maintainer of that kernel source file.}(hjchhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(h!How to format kernel-doc commentsh]h!How to format kernel-doc comments}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK(ubh)}(hXThe opening comment mark ``/**`` is used for kernel-doc comments. The ``kernel-doc`` tool will extract comments marked this way. The rest of the comment is formatted like a normal multi-line comment with a column of asterisks on the left side, closing with ``*/`` on a line by itself.h](hThe opening comment mark }(hjhhhNhNubj8)}(h``/**``h]h/**}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh& is used for kernel-doc comments. The }(hjhhhNhNubj8)}(h``kernel-doc``h]h kernel-doc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh tool will extract comments marked this way. The rest of the comment is formatted like a normal multi-line comment with a column of asterisks on the left side, closing with }(hjhhhNhNubj8)}(h``*/``h]h*/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh on a line by itself.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK*hjhhubh)}(hX%The function and type kernel-doc comments should be placed just before the function or type being described in order to maximise the chance that somebody changing the code will also change the documentation. The overview kernel-doc comments may be placed anywhere at the top indentation level.h]hX%The function and type kernel-doc comments should be placed just before the function or type being described in order to maximise the chance that somebody changing the code will also change the documentation. The overview kernel-doc comments may be placed anywhere at the top indentation level.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjhhubh)}(hRunning the ``kernel-doc`` tool with increased verbosity and without actual output generation may be used to verify proper formatting of the documentation comments. For example::h](h Running the }(hjhhhNhNubj8)}(h``kernel-doc``h]h kernel-doc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh tool with increased verbosity and without actual output generation may be used to verify proper formatting of the documentation comments. For example:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK5hjhhubh literal_block)}(h-scripts/kernel-doc -v -none drivers/foo/bar.ch]h-scripts/kernel-doc -v -none drivers/foo/bar.c}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK9hjhhubh)}(hkThe documentation format is verified by the kernel build when it is requested to perform extra gcc checks::h]hjThe documentation format is verified by the kernel build when it is requested to perform extra gcc checks:}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjhhubj)}(hmake W=nh]hmake W=n}hj8sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhK>hjhhubeh}(h]!how-to-format-kernel-doc-commentsah ]h"]!how to format kernel-doc commentsah$]h&]uh1hhhhhhhhK(ubh)}(hhh](h)}(hFunction documentationh]hFunction documentation}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhKAubh)}(hPThe general format of a function and function-like macro kernel-doc comment is::h]hOThe general format of a function and function-like macro kernel-doc comment is:}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjNhhubj)}(hX^/** * function_name() - Brief description of function. * @arg1: Describe the first argument. * @arg2: Describe the second argument. * One can provide multiple line descriptions * for arguments. * * A longer description, with more discussion of the function function_name() * that might be useful to those using or modifying it. Begins with an * empty comment line, and may include additional embedded empty * comment lines. * * The longer description may have multiple paragraphs. * * Context: Describes whether the function can sleep, what locks it takes, * releases, or expects to be held. It can extend over multiple * lines. * Return: Describe the return value of function_name. * * The return value description can also have multiple paragraphs, and should * be placed at the end of the comment block. */h]hX^/** * function_name() - Brief description of function. * @arg1: Describe the first argument. * @arg2: Describe the second argument. * One can provide multiple line descriptions * for arguments. * * A longer description, with more discussion of the function function_name() * that might be useful to those using or modifying it. Begins with an * empty comment line, and may include additional embedded empty * comment lines. * * The longer description may have multiple paragraphs. * * Context: Describes whether the function can sleep, what locks it takes, * releases, or expects to be held. It can extend over multiple * lines. * Return: Describe the return value of function_name. * * The return value description can also have multiple paragraphs, and should * be placed at the end of the comment block. */}hjmsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKEhjNhhubh)}(hThe brief description following the function name may span multiple lines, and ends with an argument description, a blank comment line, or the end of the comment block.h]hThe brief description following the function name may span multiple lines, and ends with an argument description, a blank comment line, or the end of the comment block.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjNhhubh)}(hhh](h)}(hFunction parametersh]hFunction parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKaubh)}(hEach function argument should be described in order, immediately following the short function description. Do not leave a blank line between the function description and the arguments, nor between the arguments.h]hEach function argument should be described in order, immediately following the short function description. Do not leave a blank line between the function description and the arguments, nor between the arguments.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjhhubh)}(h8Each ``@argument:`` description may span multiple lines.h](hEach }(hjhhhNhNubj8)}(h``@argument:``h]h @argument:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh% description may span multiple lines.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKghjhhubh)}(hXGIf the ``@argument`` description has multiple lines, the continuation of the description should start at the same column as the previous line:: * @argument: some long description * that continues on next lines or:: * @argument: * some long description * that continues on next linesh](h)}(hIf the ``@argument`` description has multiple lines, the continuation of the description should start at the same column as the previous line::h](hIf the }(hjhhhNhNubj8)}(h ``@argument``h]h @argument}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubhz description has multiple lines, the continuation of the description should start at the same column as the previous line:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKkhjubj)}(hL* @argument: some long description * that continues on next linesh]hL* @argument: some long description * that continues on next lines}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKnhjubh)}(hor::h]hor:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubj)}(hS* @argument: * some long description * that continues on next linesh]hS* @argument: * some long description * that continues on next lines}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKshjubeh}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hoIf a function has a variable number of arguments, its description should be written in kernel-doc notation as::h]hnIf a function has a variable number of arguments, its description should be written in kernel-doc notation as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjhhubj)}(h* @...: descriptionh]h* @...: description}hj*sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKzhjhhubeh}(h]function-parametersah ]h"]function parametersah$]h&]uh1hhjNhhhhhKaubh)}(hhh](h)}(hFunction contexth]hFunction context}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhK}ubh)}(hX The context in which a function can be called should be described in a section named ``Context``. This should include whether the function sleeps or can be called from interrupt context, as well as what locks it takes, releases and expects to be held by its caller.h](hUThe context in which a function can be called should be described in a section named }(hjQhhhNhNubj8)}(h ``Context``h]hContext}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjQubh. This should include whether the function sleeps or can be called from interrupt context, as well as what locks it takes, releases and expects to be held by its caller.}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj@hhubh)}(h Examples::h]h Examples:}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@hhubj)}(hXj* Context: Any context. * Context: Any context. Takes and releases the RCU lock. * Context: Any context. Expects to be held by caller. * Context: Process context. May sleep if @gfp flags permit. * Context: Process context. Takes and releases . * Context: Softirq or process context. Takes and releases , BH-safe. * Context: Interrupt context.h]hXj* Context: Any context. * Context: Any context. Takes and releases the RCU lock. * Context: Any context. Expects to be held by caller. * Context: Process context. May sleep if @gfp flags permit. * Context: Process context. Takes and releases . * Context: Softirq or process context. Takes and releases , BH-safe. * Context: Interrupt context.}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhj@hhubeh}(h]function-contextah ]h"]function contextah$]h&]uh1hhjNhhhhhK}ubh)}(hhh](h)}(h Return valuesh]h Return values}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hgThe return value, if any, should be described in a dedicated section named ``Return`` (or ``Returns``).h](hKThe return value, if any, should be described in a dedicated section named }(hjhhhNhNubj8)}(h ``Return``h]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh (or }(hjhhhNhNubj8)}(h ``Returns``h]hReturns}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX #) The multi-line descriptive text you provide does *not* recognize line breaks, so if you try to format some text nicely, as in:: * Return: * %0 - OK * %-EINVAL - invalid argument * %-ENOMEM - out of memory this will all run together and produce:: Return: 0 - OK -EINVAL - invalid argument -ENOMEM - out of memory So, in order to produce the desired line breaks, you need to use a ReST list, e. g.:: * Return: * * %0 - OK to runtime suspend the device * * %-EBUSY - Device should not be runtime suspended #) If the descriptive text you provide has lines that begin with some phrase followed by a colon, each of those phrases will be taken as a new section heading, which probably won't produce the desired effect.h]henumerated_list)}(hhh](h list_item)}(hXThe multi-line descriptive text you provide does *not* recognize line breaks, so if you try to format some text nicely, as in:: * Return: * %0 - OK * %-EINVAL - invalid argument * %-ENOMEM - out of memory this will all run together and produce:: Return: 0 - OK -EINVAL - invalid argument -ENOMEM - out of memory So, in order to produce the desired line breaks, you need to use a ReST list, e. g.:: * Return: * * %0 - OK to runtime suspend the device * * %-EBUSY - Device should not be runtime suspended h](h)}(hThe multi-line descriptive text you provide does *not* recognize line breaks, so if you try to format some text nicely, as in::h](h1The multi-line descriptive text you provide does }(hjhhhNhNubhemphasis)}(h*not*h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhH recognize line breaks, so if you try to format some text nicely, as in:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hL* Return: * %0 - OK * %-EINVAL - invalid argument * %-ENOMEM - out of memoryh]hL* Return: * %0 - OK * %-EINVAL - invalid argument * %-ENOMEM - out of memory}hj sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhjubh)}(h(this will all run together and produce::h]h'this will all run together and produce:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hAReturn: 0 - OK -EINVAL - invalid argument -ENOMEM - out of memoryh]hAReturn: 0 - OK -EINVAL - invalid argument -ENOMEM - out of memory}hj%sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhjubh)}(hUSo, in order to produce the desired line breaks, you need to use a ReST list, e. g.::h]hTSo, in order to produce the desired line breaks, you need to use a ReST list, e. g.:}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hy* Return: * * %0 - OK to runtime suspend the device * * %-EBUSY - Device should not be runtime suspendedh]hy* Return: * * %0 - OK to runtime suspend the device * * %-EBUSY - Device should not be runtime suspended}hjAsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hIf the descriptive text you provide has lines that begin with some phrase followed by a colon, each of those phrases will be taken as a new section heading, which probably won't produce the desired effect.h]h)}(hIf the descriptive text you provide has lines that begin with some phrase followed by a colon, each of those phrases will be taken as a new section heading, which probably won't produce the desired effect.h]hIf the descriptive text you provide has lines that begin with some phrase followed by a colon, each of those phrases will be taken as a new section heading, which probably won’t produce the desired effect.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjUubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix)uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h] return-valuesah ]h"] return valuesah$]h&]uh1hhjNhhhhhKubeh}(h]function-documentationah ]h"]function documentationah$]h&]uh1hhhhhhhhKAubh)}(hhh](h)}(h/Structure, union, and enumeration documentationh]h/Structure, union, and enumeration documentation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hGThe general format of a struct, union, and enum kernel-doc comment is::h]hFThe general format of a struct, union, and enum kernel-doc comment is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(h/** * struct struct_name - Brief description. * @member1: Description of member1. * @member2: Description of member2. * One can provide multiple line descriptions * for members. * * Description of the structure. */h]h/** * struct struct_name - Brief description. * @member1: Description of member1. * @member2: Description of member2. * One can provide multiple line descriptions * for members. * * Description of the structure. */}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhjhhubh)}(hYou can replace the ``struct`` in the above example with ``union`` or ``enum`` to describe unions or enums. ``member`` is used to mean struct and union member names as well as enumerations in an enum.h](hYou can replace the }(hjhhhNhNubj8)}(h ``struct``h]hstruct}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh in the above example with }(hjhhhNhNubj8)}(h ``union``h]hunion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h``enum``h]henum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh to describe unions or enums. }(hjhhhNhNubj8)}(h ``member``h]hmember}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubhR is used to mean struct and union member names as well as enumerations in an enum.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe brief description following the structure name may span multiple lines, and ends with a member description, a blank comment line, or the end of the comment block.h]hThe brief description following the structure name may span multiple lines, and ends with a member description, a blank comment line, or the end of the comment block.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hMembersh]hMembers}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hMembers of structs, unions and enums should be documented the same way as function parameters; they immediately succeed the short description and may be multi-line.h]hMembers of structs, unions and enums should be documented the same way as function parameters; they immediately succeed the short description and may be multi-line.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hInside a struct or union description, you can use the ``private:`` and ``public:`` comment tags. Structure fields that are inside a ``private:`` area are not listed in the generated output documentation.h](h6Inside a struct or union description, you can use the }(hj>hhhNhNubj8)}(h ``private:``h]hprivate:}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj>ubh and }(hj>hhhNhNubj8)}(h ``public:``h]hpublic:}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj>ubh2 comment tags. Structure fields that are inside a }(hj>hhhNhNubj8)}(h ``private:``h]hprivate:}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj>ubh; area are not listed in the generated output documentation.}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe ``private:`` and ``public:`` tags must begin immediately following a ``/*`` comment marker. They may optionally include comments between the ``:`` and the ending ``*/`` marker.h](hThe }(hjhhhNhNubj8)}(h ``private:``h]hprivate:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and }(hjhhhNhNubj8)}(h ``public:``h]hpublic:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh) tags must begin immediately following a }(hjhhhNhNubj8)}(h``/*``h]h/*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubhB comment marker. They may optionally include comments between the }(hjhhhNhNubj8)}(h``:``h]h:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and the ending }(hjhhhNhNubj8)}(h``*/``h]h*/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh marker.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX/** * struct my_struct - short description * @a: first member * @b: second member * @d: fourth member * * Longer description */ struct my_struct { int a; int b; /* private: internal use only */ int c; /* public: the next one is public */ int d; };h]hX/** * struct my_struct - short description * @a: first member * @b: second member * @d: fourth member * * Longer description */ struct my_struct { int a; int b; /* private: internal use only */ int c; /* public: the next one is public */ int d; };}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKhjhhubeh}(h]membersah ]h"]membersah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hNested structs/unionsh]hNested structs/unions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hhhhNhNubah}(h]h ]h"]h$]h&]nameSphinx C Domainjjuh1jhj6jKubh references.}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj%hhubh attention)}(hoThe below are **only** recognized within kernel-doc comments, **not** within normal reStructuredText documents.h]h)}(hoThe below are **only** recognized within kernel-doc comments, **not** within normal reStructuredText documents.h](hThe below are }(hj^hhhNhNubhstrong)}(h**only**h]honly}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jfhj^ubh( recognized within kernel-doc comments, }(hj^hhhNhNubjg)}(h**not**h]hnot}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jfhj^ubh* within normal reStructuredText documents.}(hj^hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjZubah}(h]h ]h"]h$]h&]uh1jXhj%hhhhhNubhdefinition_list)}(hhh](hdefinition_list_item)}(h#``funcname()`` Function reference. h](hterm)}(h``funcname()``h]j8)}(hjh]h funcname()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubh definition)}(hhh]h)}(hFunction reference.h]hFunction reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hV``@parameter`` Name of a function parameter. (No cross-referencing, just formatting.) h](j)}(h``@parameter``h]j8)}(hjh]h @parameter}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hFName of a function parameter. (No cross-referencing, just formatting.)h]hFName of a function parameter. (No cross-referencing, just formatting.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubj)}(hH``%CONST`` Name of a constant. (No cross-referencing, just formatting.) h](j)}(h ``%CONST``h]j8)}(hj h]h%CONST}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh]h)}(hmember`` or ``&struct_name.member`` Structure or union member reference. The cross-reference will be to the struct or union definition, not the member directly. h](j)}(h3``&struct_name->member`` or ``&struct_name.member``h](j8)}(h``&struct_name->member``h]h&struct_name->member}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh or }(hj hhhNhNubj8)}(h``&struct_name.member``h]h&struct_name.member}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh]h)}(h|Structure or union member reference. The cross-reference will be to the struct or union definition, not the member directly.h]h|Structure or union member reference. The cross-reference will be to the struct or union definition, not the member directly.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubj)}(h``&name`` A generic type reference. Prefer using the full reference described above instead. This is mostly for legacy comments. h](j)}(h ``&name``h]j8)}(hj h]h&name}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh]h)}(hvA generic type reference. Prefer using the full reference described above instead. This is mostly for legacy comments.h]hvA generic type reference. Prefer using the full reference described above instead. This is mostly for legacy comments.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubeh}(h]h ]h"]h$]h&]uh1jhj%hhhhhNubh)}(hhh](h)}(h'Cross-referencing from reStructuredTexth]h'Cross-referencing from reStructuredText}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj, hhhhhMubh)}(hXNo additional syntax is needed to cross-reference the functions and types defined in the kernel-doc comments from reStructuredText documents. Just end function names with ``()`` and write ``struct``, ``union``, ``enum`` or ``typedef`` before types. For example::h](hNo additional syntax is needed to cross-reference the functions and types defined in the kernel-doc comments from reStructuredText documents. Just end function names with }(hj= hhhNhNubj8)}(h``()``h]h()}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj= ubh and write }(hj= hhhNhNubj8)}(h ``struct``h]hstruct}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj= ubh, }(hj= hhhNhNubj8)}(h ``union``h]hunion}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj= ubh, }hj= sbj8)}(h``enum``h]henum}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj= ubh or }(hj= hhhNhNubj8)}(h ``typedef``h]htypedef}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj= ubh before types. For example:}(hj= hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj, hhubj)}(hHSee foo(). See struct foo. See union bar. See enum baz. See typedef meh.h]hHSee foo(). See struct foo. See union bar. See enum baz. See typedef meh.}hj sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhj, hhubh)}(hmHowever, if you want custom text in the cross-reference link, that can be done through the following syntax::h]hlHowever, if you want custom text in the cross-reference link, that can be done through the following syntax:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj, hhubj)}(hqSee :c:func:`my custom link text for function foo `. See :c:type:`my custom link text for struct bar `.h]hqSee :c:func:`my custom link text for function foo `. See :c:type:`my custom link text for struct bar `.}hj sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhj, hhubh)}(hJFor further details, please refer to the `Sphinx C Domain`_ documentation.h](h)For further details, please refer to the }(hj hhhNhNubj)}(h`Sphinx C Domain`_h]hSphinx C Domain}(hj hhhNhNubah}(h]h ]h"]h$]h&]nameSphinx C Domainjjuh1jhj jKubh documentation.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj, hhubeh}(h]'cross-referencing-from-restructuredtextah ]h"]'cross-referencing from restructuredtextah$]h&]uh1hhj%hhhhhMubeh}(h]highlights-and-cross-referencesah ]h"]highlights and cross-referencesah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hOverview documentation commentsh]hOverview documentation comments}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hXCTo facilitate having source code and comments close together, you can include kernel-doc documentation blocks that are free-form comments instead of being kernel-doc for functions, structures, unions, enums, or typedefs. This could be used for something like a theory of operation for a driver or library code, for example.h]hXCTo facilitate having source code and comments close together, you can include kernel-doc documentation blocks that are free-form comments instead of being kernel-doc for functions, structures, unions, enums, or typedefs. This could be used for something like a theory of operation for a driver or library code, for example.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hFThis is done by using a ``DOC:`` section keyword with a section title.h](hThis is done by using a }(hj hhhNhNubj8)}(h``DOC:``h]hDOC:}(hj( hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh& section keyword with a section title.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hJThe general format of an overview or high-level documentation comment is::h]hIThe general format of an overview or high-level documentation comment is:}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hX7/** * DOC: Theory of Operation * * The whizbang foobar is a dilly of a gizmo. It can do whatever you * want it to do, at any time. It reads your mind. Here's how it works. * * foo bar splat * * The only drawback to this gizmo is that is can sometimes damage * hardware, software, or its subject(s). */h]hX7/** * DOC: Theory of Operation * * The whizbang foobar is a dilly of a gizmo. It can do whatever you * want it to do, at any time. It reads your mind. Here's how it works. * * foo bar splat * * The only drawback to this gizmo is that is can sometimes damage * hardware, software, or its subject(s). */}hjN sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhj hhubh)}(hThe title following ``DOC:`` acts as a heading within the source file, but also as an identifier for extracting the documentation comment. Thus, the title must be unique within the file.h](hThe title following }(hj\ hhhNhNubj8)}(h``DOC:``h]hDOC:}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj\ ubh acts as a heading within the source file, but also as an identifier for extracting the documentation comment. Thus, the title must be unique within the file.}(hj\ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]overview-documentation-commentsah ]h"]overview documentation commentsah$]h&]uh1hhhhhhhhMubeh}(h]writing-kernel-doc-commentsah ]h"]writing kernel-doc commentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hIncluding kernel-doc commentsh]hIncluding kernel-doc comments}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hThe documentation comments may be included in any of the reStructuredText documents using a dedicated kernel-doc Sphinx directive extension.h]hThe documentation comments may be included in any of the reStructuredText documents using a dedicated kernel-doc Sphinx directive extension.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h+The kernel-doc directive is of the format::h]h*The kernel-doc directive is of the format:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(h".. kernel-doc:: source :option:h]h".. kernel-doc:: source :option:}hj sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhj hhubh)}(h}The *source* is the path to a source file, relative to the kernel source tree. The following directive options are supported:h](hThe }(hj hhhNhNubj)}(h*source*h]hsource}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhq is the path to a source file, relative to the kernel source tree. The following directive options are supported:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hhh](j)}(hXexport: *[source-pattern ...]* Include documentation for all functions in *source* that have been exported using ``EXPORT_SYMBOL`` or ``EXPORT_SYMBOL_GPL`` either in *source* or in any of the files specified by *source-pattern*. The *source-pattern* is useful when the kernel-doc comments have been placed in header files, while ``EXPORT_SYMBOL`` and ``EXPORT_SYMBOL_GPL`` are next to the function definitions. Examples:: .. kernel-doc:: lib/bitmap.c :export: .. kernel-doc:: include/net/mac80211.h :export: net/mac80211/*.c h](j)}(hexport: *[source-pattern ...]*h](hexport: }(hj hhhNhNubj)}(h*[source-pattern ...]*h]h[source-pattern ...]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh](h)}(hInclude documentation for all functions in *source* that have been exported using ``EXPORT_SYMBOL`` or ``EXPORT_SYMBOL_GPL`` either in *source* or in any of the files specified by *source-pattern*.h](h+Include documentation for all functions in }(hj hhhNhNubj)}(h*source*h]hsource}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh that have been exported using }(hj hhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh or }(hj hhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh either in }(hj hhhNhNubj)}(h*source*h]hsource}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh% or in any of the files specified by }(hj hhhNhNubj)}(h*source-pattern*h]hsource-pattern}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(hThe *source-pattern* is useful when the kernel-doc comments have been placed in header files, while ``EXPORT_SYMBOL`` and ``EXPORT_SYMBOL_GPL`` are next to the function definitions.h](hThe }(hju hhhNhNubj)}(h*source-pattern*h]hsource-pattern}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1jhju ubhP is useful when the kernel-doc comments have been placed in header files, while }(hju hhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hju ubh and }(hju hhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hju ubh& are next to the function definitions.}(hju hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(h Examples::h]h Examples:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(hm.. kernel-doc:: lib/bitmap.c :export: .. kernel-doc:: include/net/mac80211.h :export: net/mac80211/*.ch]hm.. kernel-doc:: lib/bitmap.c :export: .. kernel-doc:: include/net/mac80211.h :export: net/mac80211/*.c}hj sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hXJinternal: *[source-pattern ...]* Include documentation for all functions and types in *source* that have **not** been exported using ``EXPORT_SYMBOL`` or ``EXPORT_SYMBOL_GPL`` either in *source* or in any of the files specified by *source-pattern*. Example:: .. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :internal: h](j)}(h internal: *[source-pattern ...]*h](h internal: }(hj hhhNhNubj)}(h*[source-pattern ...]*h]h[source-pattern ...]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh](h)}(hInclude documentation for all functions and types in *source* that have **not** been exported using ``EXPORT_SYMBOL`` or ``EXPORT_SYMBOL_GPL`` either in *source* or in any of the files specified by *source-pattern*.h](h5Include documentation for all functions and types in }(hjhhhNhNubj)}(h*source*h]hsource}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh that have }(hjhhhNhNubjg)}(h**not**h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jfhjubh been exported using }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh either in }(hjhhhNhNubj)}(h*source*h]hsource}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh% or in any of the files specified by }(hjhhhNhNubj)}(h*source-pattern*h]hsource-pattern}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(h Example::h]hExample:}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(h@.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :internal:h]h@.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :internal:}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj hhubj)}(hXidentifiers: *[ function/type ...]* Include documentation for each *function* and *type* in *source*. If no *function* is specified, the documentation for all functions and types in the *source* will be included. *type* can be a struct, union, enum, or typedef identifier. Examples:: .. kernel-doc:: lib/bitmap.c :identifiers: bitmap_parselist bitmap_parselist_user .. kernel-doc:: lib/idr.c :identifiers: h](j)}(h#identifiers: *[ function/type ...]*h](h identifiers: }(hjhhhNhNubj)}(h*[ function/type ...]*h]h[ function/type ...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM hjubj)}(hhh](h)}(hInclude documentation for each *function* and *type* in *source*. If no *function* is specified, the documentation for all functions and types in the *source* will be included. *type* can be a struct, union, enum, or typedef identifier.h](hInclude documentation for each }(hj3hhhNhNubj)}(h *function*h]hfunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h*type*h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh in }(hjhhhNhNubj)}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. If no }(hjhhhNhNubj)}(h *function*h]hfunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhD is specified, the documentation for all functions and types in the }(hjhhhNhNubj)}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh will be included. }(hjhhhNhNubj)}(h*type*h]htype}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh5 can be a struct, union, enum, or typedef identifier.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h Examples::h]h Examples:}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(h.. kernel-doc:: lib/bitmap.c :identifiers: bitmap_parselist bitmap_parselist_user .. kernel-doc:: lib/idr.c :identifiers:h]h.. kernel-doc:: lib/bitmap.c :identifiers: bitmap_parselist bitmap_parselist_user .. kernel-doc:: lib/idr.c :identifiers:}hjQsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM hj hhubj)}(hno-identifiers: *[ function/type ...]* Exclude documentation for each *function* and *type* in *source*. Example:: .. kernel-doc:: lib/bitmap.c :no-identifiers: bitmap_parselist h](j)}(h&no-identifiers: *[ function/type ...]*h](hno-identifiers: }(hjohhhNhNubj)}(h*[ function/type ...]*h]h[ function/type ...]}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1jhhhM(hjkubj)}(hhh](h)}(hAExclude documentation for each *function* and *type* in *source*.h](hExclude documentation for each }(hjhhhNhNubj)}(h *function*h]hfunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h*type*h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh in }(hjhhhNhNubj)}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM#hjubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hjubj)}(hA.. kernel-doc:: lib/bitmap.c :no-identifiers: bitmap_parselisth]hA.. kernel-doc:: lib/bitmap.c :no-identifiers: bitmap_parselist}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhM'hjubeh}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jhhhM(hj hhubj)}(hbfunctions: *[ function/type ...]* This is an alias of the 'identifiers' directive and deprecated. h](j)}(h!functions: *[ function/type ...]*h](h functions: }(hjhhhNhNubj)}(h*[ function/type ...]*h]h[ function/type ...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM+hjubj)}(hhh]h)}(h?This is an alias of the 'identifiers' directive and deprecated.h]hCThis is an alias of the ‘identifiers’ directive and deprecated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM+hj hhubj)}(hXdoc: *title* Include documentation for the ``DOC:`` paragraph identified by *title* in *source*. Spaces are allowed in *title*; do not quote the *title*. The *title* is only used as an identifier for the paragraph, and is not included in the output. Please make sure to have an appropriate heading in the enclosing reStructuredText document. Example:: .. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :doc: High Definition Audio over HDMI and Display Port h](j)}(h doc: *title*h](hdoc: }(hj;hhhNhNubj)}(h*title*h]htitle}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhhhM7hj7ubj)}(hhh](h)}(hXHInclude documentation for the ``DOC:`` paragraph identified by *title* in *source*. Spaces are allowed in *title*; do not quote the *title*. The *title* is only used as an identifier for the paragraph, and is not included in the output. Please make sure to have an appropriate heading in the enclosing reStructuredText document.h](hInclude documentation for the }(hjZhhhNhNubj8)}(h``DOC:``h]hDOC:}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjZubh paragraph identified by }(hjZhhhNhNubj)}(h*title*h]htitle}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh in }(hjZhhhNhNubj)}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh. Spaces are allowed in }(hjZhhhNhNubj)}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh; do not quote the }(hjZhhhNhNubj)}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh. The }(hjZhhhNhNubj)}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh is only used as an identifier for the paragraph, and is not included in the output. Please make sure to have an appropriate heading in the enclosing reStructuredText document.}(hjZhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM.hjWubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hjWubj)}(hl.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :doc: High Definition Audio over HDMI and Display Porth]hl.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :doc: High Definition Audio over HDMI and Display Port}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhM6hjWubeh}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1jhhhM7hj hhubeh}(h]h ]h"]h$]h&]uh1jhj hhhhhNubh)}(hcWithout options, the kernel-doc directive includes all documentation comments from the source file.h]hcWithout options, the kernel-doc directive includes all documentation comments from the source file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hj hhubh)}(hThe kernel-doc extension is included in the kernel source tree, at ``Documentation/sphinx/kerneldoc.py``. Internally, it uses the ``scripts/kernel-doc`` script to extract the documentation comments from the source.h](hCThe kernel-doc extension is included in the kernel source tree, at }(hjhhhNhNubj8)}(h%``Documentation/sphinx/kerneldoc.py``h]h!Documentation/sphinx/kerneldoc.py}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh. Internally, it uses the }(hjhhhNhNubj8)}(h``scripts/kernel-doc``h]hscripts/kernel-doc}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh> script to extract the documentation comments from the source.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM<hj hhubj!)}(h.. _kernel_doc:h]h}(h]h ]h"]h$]h&]refid kernel-docuh1j hMAhj hhhhubh)}(hhh](h)}(h+How to use kernel-doc to generate man pagesh]h+How to use kernel-doc to generate man pages}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhMDubh)}(hcIf you just want to use kernel-doc to generate man pages you can do this from the kernel git tree::h]hbIf you just want to use kernel-doc to generate man pages you can do this from the kernel git tree:}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhjNhhubj)}(hs$ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- :^Documentation :^tools) \ | scripts/split-man.pl /tmp/manh]hs$ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- :^Documentation :^tools) \ | scripts/split-man.pl /tmp/man}hjmsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMIhjNhhubh)}(hSome older versions of git do not support some of the variants of syntax for path exclusion. One of the following commands may work for those versions::h]hSome older versions of git do not support some of the variants of syntax for path exclusion. One of the following commands may work for those versions:}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhjNhhubj)}(hX$ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- . ':!Documentation' ':!tools') \ | scripts/split-man.pl /tmp/man $ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- . ":(exclude)Documentation" ":(exclude)tools") \ | scripts/split-man.pl /tmp/manh]hX$ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- . ':!Documentation' ':!tools') \ | scripts/split-man.pl /tmp/man $ scripts/kernel-doc -man \ $(git grep -l '/\*\*' -- . ":(exclude)Documentation" ":(exclude)tools") \ | scripts/split-man.pl /tmp/man}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMPhjNhhubeh}(h](+how-to-use-kernel-doc-to-generate-man-pagesjMeh ]h"](+how to use kernel-doc to generate man pages kernel_doceh$]h&]uh1hhj hhhhhMDexpect_referenced_by_name}jjBsexpect_referenced_by_id}jMjBsubeh}(h]including-kernel-doc-commentsah ]h"]including kernel-doc commentsah$]h&]uh1hhhhhhhhMubeh}(h]h ]h"]h$]h&]sourcehhKernel-doc commentsuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}sphinx c domain](jj>j esrefids}jM]jBasnameids}(j j j+j(jKjHjjj=j:jjjjj6j3j jjjj.j+jjj"jj j j j j j~ jjjjMjju nametypes}(j j+jKjj=jjj6j jj.jj"j j j jjjuh}(j hj(j"jHjjjNj:jjj@jjj3jjjjjj+jjj9jjj j%j j, j~ j jj jMjNjjNu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h0Hyperlink target "kernel-doc" is not referenced.}hj<sbah}(h]h ]h"]h$]h&]uh1hhj9ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineMAuh1j7uba transformerN include_log] decorationNhhub.