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)}(h0tools/docs/kernel-doc -v -none drivers/foo/bar.ch]h0tools/docs/kernel-doc -v -none drivers/foo/bar.c}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK9hjhhubh)}(hThe documentation format of ``.c`` files is also verified by the kernel build when it is requested to perform extra gcc checks::h](hThe documentation format of }(hj*hhhNhNubj8)}(h``.c``h]h.c}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj*ubh] files is also verified by the kernel build when it is requested to perform extra gcc checks:}(hj*hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK;hjhhubj)}(hmake W=nh]hmake W=n}hjJsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhK>hjhhubh)}(hqHowever, the above command does not verify header files. These should be checked separately using ``kernel-doc``.h](hbHowever, the above command does not verify header files. These should be checked separately using }(hjXhhhNhNubj8)}(h``kernel-doc``h]h kernel-doc}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjXubh.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK@hjhhubeh}(h]!how-to-format-kernel-doc-commentsah ]h"]!how to format kernel-doc commentsah$]h&]uh1hhhhhhhhK(ubh)}(hhh](h)}(hFunction documentationh]hFunction documentation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKDubh)}(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:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjhhubj)}(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. */}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKHhjhhubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubh)}(hhh](h)}(hFunction parametersh]hFunction parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKdubh)}(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&]uh1hhhhKfhjhhubh)}(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&]uh1hhhhKjhjhhubh)}(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&]uh1hhhhKnhjubj)}(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)uh1jhhhKqhjubh)}(hor::h]hor:}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjubj)}(hS* @argument: * some long description * that continues on next linesh]hS* @argument: * some long description * that continues on next lines}hj:sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhKvhjubeh}(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:}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjhhubj)}(h* @...: descriptionh]h* @...: description}hj\sbah}(h]h ]h"]h$]h&]j(j)uh1jhhhK}hjhhubeh}(h]function-parametersah ]h"]function parametersah$]h&]uh1hhjhhhhhKdubh)}(hhh](h)}(hFunction contexth]hFunction context}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhhhhhKubh)}(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 }(hjhhhNhNubj8)}(h ``Context``h]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh. 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjrhhubh)}(h Examples::h]h Examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjrhhubj)}(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)uh1jhhhKhjrhhubeh}(h]function-contextah ]h"]function contextah$]h&]uh1hhjhhhhhKubh)}(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}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubhH 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:}(hjIhhhNhNubah}(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}hjWsbah}(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.:}(hjehhhNhNubah}(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}hjssbah}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix)uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h] return-valuesah ]h"] return valuesah$]h&]uh1hhjhhhhhKubeh}(h]function-documentationah ]h"]function documentationah$]h&]uh1hhhhhhhhKDubh)}(hhh](h)}(h/Structure, union, and enumeration documentationh]h/Structure, union, and enumeration documentation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hSThe general format of a ``struct``, ``union``, and ``enum`` kernel-doc comment is::h](hThe general format of a }(hjhhhNhNubj8)}(h ``struct``h]hstruct}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh, }(hjhhhNhNubj8)}(h ``union``h]hunion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh, and }(hjhhhNhNubj8)}(h``enum``h]henum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh kernel-doc comment is:}(hjhhhNhNubeh}(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 }(hj#hhhNhNubj8)}(h ``struct``h]hstruct}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh in the above example with }(hj#hhhNhNubj8)}(h ``union``h]hunion}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh or }(hj#hhhNhNubj8)}(h``enum``h]henum}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh to describe unions or enums. }(hj#hhhNhNubj8)}(h ``member``h]hmember}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh is used to mean }(hj#hhhNhNubj8)}(h ``struct``h]hstruct}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh and }(hj#hhhNhNubj8)}(h ``union``h]hunion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh, member names as well as enumerations in an }(hj#hhhNhNubj8)}(h``enum``h]henum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj#ubh.}(hj#hhhNhNubeh}(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}(hjhhhNhNubah}(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.}(hjhhhNhNubah}(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](h Inside a }(hjhhhNhNubj8)}(h ``struct``h]hstruct}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h ``union``h]hunion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh description, you can use the }(hjhhhNhNubj8)}(h ``private:``h]hprivate:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and }(hjhhhNhNubj8)}(h ``public:``h]hpublic:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh2 comment tags. Structure fields that are inside a }(hjhhhNhNubj8)}(h ``private:``h]hprivate:}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh; area are not listed in the generated output documentation.}(hjhhhNhNubeh}(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 }(hjDhhhNhNubj8)}(h ``private:``h]hprivate:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjDubh and }(hjDhhhNhNubj8)}(h ``public:``h]hpublic:}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjDubh) tags must begin immediately following a }(hjDhhhNhNubj8)}(h``/*``h]h/*}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjDubhB comment marker. They may optionally include comments between the }(hjDhhhNhNubj8)}(h``:``h]h:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjDubh and the ending }(hjDhhhNhNubj8)}(h``*/``h]h*/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjDubh marker.}(hjDhhhNhNubeh}(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)}(hmember`` or ``&struct_name.member`` ``struct`` 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&]uh1j hhhMhj ubj )}(hhh]h)}(h``struct`` or ``union`` member reference. The cross-reference will be to the ``struct`` or ``union`` definition, not the member directly.h](j8)}(h ``struct``h]hstruct}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh or }(hjA hhhNhNubj8)}(h ``union``h]hunion}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh6 member reference. The cross-reference will be to the }(hjA hhhNhNubj8)}(h ``struct``h]hstruct}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh or }hjA sbj8)}(h ``union``h]hunion}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh% definition, not the member directly.}(hjA hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj> ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj hhubj )}(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&]uh1j hhhMhj 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&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj hhubeh}(h]h ]h"]h$]h&]uh1j hjv 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()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh and write }(hj hhhNhNubj8)}(h ``struct``h]hstruct}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, }(hj hhhNhNubj8)}(h ``union``h]hunion}(hj 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.}hjV 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:}(hjd 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 `.}hjr 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 hhubh)}(hrVariables aren't automatically cross referenced. For those, you need to explicitly add a C domain cross-reference.h]h)}(hrVariables aren't automatically cross referenced. For those, you need to explicitly add a C domain cross-reference.h]htVariables aren’t automatically cross referenced. For those, you need to explicitly add a C domain cross-reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]'cross-referencing-from-restructuredtextah ]h"]'cross-referencing from restructuredtextah$]h&]uh1hhjv 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)}(hXMTo 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, typedefs or variables. This could be used for something like a theory of operation for a driver or library code, for example.h]hXMTo 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, typedefs or variables. 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). */}hjsbah}(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:}(hj-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}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhhhhhMubh)}(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.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjUhhubh)}(h+The kernel-doc directive is of the format::h]h*The kernel-doc directive is of the format:}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjUhhubj)}(h".. kernel-doc:: source :option:h]h".. kernel-doc:: source :option:}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhM hjUhhubh)}(h}The *source* is the path to a source file, relative to the kernel source tree. The following directive options are supported:h](hThe }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubhq is the path to a source file, relative to the kernel source tree. The following directive options are supported:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjUhhubj )}(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: }(hjhhhNhNubj")}(h*[source-pattern ...]*h]h[source-pattern ...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubeh}(h]h ]h"]h$]h&]uh1j hhhM hjubj )}(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 }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh that have been exported using }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh either in }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh% or in any of the files specified by }(hjhhhNhNubj")}(h*source-pattern*h]hsource-pattern}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(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.Lh](hThe }(hj>hhhNhNubj")}(h*source-pattern*h]hsource-pattern}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj>ubhP is useful when the kernel-doc comments have been placed in header files, while }(hj>hhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj>ubh and }(hj>hhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj>ubh& are next to the function definitions.}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h Examples::h]h Examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(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}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM hjubj )}(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: }(hjhhhNhNubj")}(h*[source-pattern ...]*h]h[source-pattern ...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubeh}(h]h ]h"]h$]h&]uh1j hhhM*hjubj )}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh that have }(hjhhhNhNubj )}(h**not**h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh been exported using }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL``h]h EXPORT_SYMBOL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h``EXPORT_SYMBOL_GPL``h]hEXPORT_SYMBOL_GPL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh either in }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh% or in any of the files specified by }(hjhhhNhNubj")}(h*source-pattern*h]hsource-pattern}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM#hjubh)}(h Example::h]hExample:}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjubj)}(h@.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :internal:h]h@.. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c :internal:}hjUsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhM)hjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM*hjhhubj )}(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``, ``typedef`` or ``var`` 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: }(hjshhhNhNubj")}(h*[ function/type ...]*h]h[ function/type ...]}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjsubeh}(h]h ]h"]h$]h&]uh1j hhhM9hjoubj )}(hhh](h)}(hXInclude 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``, ``typedef`` or ``var`` identifier.h](hInclude documentation for each }(hjhhhNhNubj")}(h *function*h]hfunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh and }(hjhhhNhNubj")}(h*type*h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh in }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh. If no }(hjhhhNhNubj")}(h *function*h]hfunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubhD is specified, the documentation for all functions and types in the }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh will be included. }(hjhhhNhNubj")}(h*type*h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh can be a }(hjhhhNhNubj8)}(h ``struct``h]hstruct}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh, }(hjhhhNhNubj8)}(h ``union``h]hunion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh, }hjsbj8)}(h``enum``h]henum}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh, }hjsbj8)}(h ``typedef``h]htypedef}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh or }(hjhhhNhNubj8)}(h``var``h]hvar}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh identifier.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM-hjubh)}(h Examples::h]h Examples:}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjubj)}(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:}hjtsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhM5hjubeh}(h]h ]h"]h$]h&]uh1j hjoubeh}(h]h ]h"]h$]h&]uh1j hhhM9hjhhubj )}(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: }(hjhhhNhNubj")}(h*[ function/type ...]*h]h[ function/type ...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubeh}(h]h ]h"]h$]h&]uh1j hhhMAhjubj )}(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&]uh1j!hjubh and }(hjhhhNhNubj")}(h*type*h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh in }(hjhhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh.}(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&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMAhjhhubj )}(hbfunctions: *[ function/type ...]* This is an alias of the 'identifiers' directive and deprecated. h](j )}(h!functions: *[ function/type ...]*h](h functions: }(hj!hhhNhNubj")}(h*[ function/type ...]*h]h[ function/type ...]}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj!ubeh}(h]h ]h"]h$]h&]uh1j hhhMDhjubj )}(hhh]h)}(h?This is an alias of the 'identifiers' directive and deprecated.h]hCThis is an alias of the ‘identifiers’ directive and deprecated.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhj=ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMDhjhhubj )}(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}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj^ubeh}(h]h ]h"]h$]h&]uh1j hhhMPhjZubj )}(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 }(hj}hhhNhNubj8)}(h``DOC:``h]hDOC:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj}ubh paragraph identified by }(hj}hhhNhNubj")}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj}ubh in }(hj}hhhNhNubj")}(h*source*h]hsource}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj}ubh. Spaces are allowed in }(hj}hhhNhNubj")}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj}ubh; do not quote the }(hj}hhhNhNubj")}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj}ubh. The }(hj}hhhNhNubj")}(h*title*h]htitle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj}ubh 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.}(hj}hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMGhjzubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhjzubj)}(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)uh1jhhhMOhjzubeh}(h]h ]h"]h$]h&]uh1j hjZubeh}(h]h ]h"]h$]h&]uh1j hhhMPhjhhubeh}(h]h ]h"]h$]h&]uh1j hjUhhhhhNubh)}(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.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhjUhhubh)}(hThe kernel-doc extension is included in the kernel source tree, at ``Documentation/sphinx/kerneldoc.py``. Internally, it uses the ``tools/docs/kernel-doc`` script to extract the documentation comments from the source.h](hCThe kernel-doc extension is included in the kernel source tree, at }(hj3hhhNhNubj8)}(h%``Documentation/sphinx/kerneldoc.py``h]h!Documentation/sphinx/kerneldoc.py}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj3ubh. Internally, it uses the }(hj3hhhNhNubj8)}(h``tools/docs/kernel-doc``h]htools/docs/kernel-doc}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj3ubh> script to extract the documentation comments from the source.}(hj3hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMUhjUhhubj!)}(h.. _kernel_doc:h]h}(h]h ]h"]h$]h&]refid kernel-docuh1j hMZhjUhhhhubh)}(hhh](h)}(h+How to use kernel-doc to generate man pagesh]h+How to use kernel-doc to generate man pages}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhhhhhM]ubh)}(hJTo generate man pages for all files that contain kernel-doc markups, run::h]hITo generate man pages for all files that contain kernel-doc markups, run:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hjqhhubj)}(h$ make mandocsh]h$ make mandocs}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMahjqhhubh)}(h.Or calling ``script-build-wrapper`` directly::h](h Or calling }(hjhhhNhNubj8)}(h``script-build-wrapper``h]hscript-build-wrapper}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh directly:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMchjqhhubj)}(h+$ ./tools/docs/sphinx-build-wrapper mandocsh]h+$ ./tools/docs/sphinx-build-wrapper mandocs}hjsbah}(h]h ]h"]h$]h&]j(j)uh1jhhhMehjqhhubh)}(hlThe output will be at ``/man`` directory inside the output directory (by default: ``Documentation/output``).h](hThe output will be at }(hjhhhNhNubj8)}(h``/man``h]h/man}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh4 directory inside the output directory (by default: }(hjhhhNhNubj8)}(h``Documentation/output``h]hDocumentation/output}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMghjqhhubh)}(hVOptionally, it is possible to generate a partial set of man pages by using SPHINXDIRS:h]hVOptionally, it is possible to generate a partial set of man pages by using SPHINXDIRS:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhjqhhubh block_quote)}(h+$ make SPHINXDIRS=driver-api/media mandocs h]h)}(h*$ make SPHINXDIRS=driver-api/media mandocsh]h*$ make SPHINXDIRS=driver-api/media mandocs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMmhjubah}(h]h ]h"]h$]h&]uh1j hhhMmhjqhhubh)}(hWhen SPHINXDIRS={subdir} is used, it will only generate man pages for the files explicitly inside a ``Documentation/{subdir}/.../*.rst`` file.h]h)}(hWhen SPHINXDIRS={subdir} is used, it will only generate man pages for the files explicitly inside a ``Documentation/{subdir}/.../*.rst`` file.h](hdWhen SPHINXDIRS={subdir} is used, it will only generate man pages for the files explicitly inside a }(hj*hhhNhNubj8)}(h$``Documentation/{subdir}/.../*.rst``h]h Documentation/{subdir}/.../*.rst}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj*ubh file.}(hj*hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMqhj&ubah}(h]h ]h"]h$]h&]uh1hhjqhhhhhNubeh}(h](+how-to-use-kernel-doc-to-generate-man-pagesjpeh ]h"](+how to use kernel-doc to generate man pages kernel_doceh$]h&]uh1hhjUhhhhhM]expect_referenced_by_name}jVjesexpect_referenced_by_id}jpjesubeh}(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}jp]jeasnameids}(jRjOj+j(j}jzjjjojljjjjj@j=jjjjj8j5jjjjjs jp j j j j jJjGjbj_jVjpjUjRu nametypes}(jRj+j}jjojjj@jjj8jjjs j j jJjbjVjUuh}(jOhj(j"jzjjjjljjjrjjj=jjjjjj5jjjCjjjp jj jv j j jGj j_jUjpjqjRjqu 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.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineMZuh1juba transformerN include_log] decorationNhhub.