€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ(/translations/zh_CN/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/zh_TW/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/it_IT/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ja_JP/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ko_KR/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/pt_BR/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/sp_SP/dev-tools/coccinelle”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ-Copyright 2010 Nicolas Palix ”h]”hŒ-Copyright 2010 Nicolas Palix ”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒB/var/lib/git/docbuild/linux/Documentation/dev-tools/coccinelle.rst”h´Kubh¶)�”}”(hŒ+Copyright 2010 Julia Lawall ”h]”hŒ+Copyright 2010 Julia Lawall ”…”�”}”hhÈsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÇh´Kubh¶)�”}”(hŒ4Copyright 2010 Gilles Muller ”h]”hŒ4Copyright 2010 Gilles Muller ”…”�”}”hhÖsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÇh´KubhŒ highlightlang”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œlang”Œnone”Œforce”‰Œlinenothreshold”Šÿÿÿÿÿÿÿuh1hähhh²hh³hÇh´KubhŒtarget”“”)�”}”(hŒ.. _devtools_coccinelle:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œdevtools-coccinelle”uh1hóh´Khhh²hh³hÇubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ Coccinelle”h]”hŒ Coccinelle”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´K ubhŒ paragraph”“”)�”}”(hŒÖCoccinelle is a tool for pattern matching and text transformation that has many uses in kernel development, including the application of complex, tree-wide patches and detection of problematic programming patterns.”h]”hŒÖCoccinelle is a tool for pattern matching and text transformation that has many uses in kernel development, including the application of complex, tree-wide patches and detection of problematic programming patterns.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K hjh²hubj)�”}”(hhh]”(j)�”}”(hŒGetting Coccinelle”h]”hŒGetting Coccinelle”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj&h²hh³hÇh´Kubj)�”}”(hŒ÷The semantic patches included in the kernel use features and options which are provided by Coccinelle version 1.0.0-rc11 and above. Using earlier versions will fail as the option names used by the Coccinelle files and coccicheck have been updated.”h]”hŒ÷The semantic patches included in the kernel use features and options which are provided by Coccinelle version 1.0.0-rc11 and above. Using earlier versions will fail as the option names used by the Coccinelle files and coccicheck have been updated.”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khj&h²hubj)�”}”(hŒQCoccinelle is available through the package manager of many distributions, e.g. :”h]”hŒQCoccinelle is available through the package manager of many distributions, e.g. :”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khj&h²hubhŒ block_quote”“”)�”}”(hŒO- Debian - Fedora - Ubuntu - OpenSUSE - Arch Linux - Gentoo - NetBSD - FreeBSD ”h]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒDebian”h]”j)�”}”(hjbh]”hŒDebian”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒFedora”h]”j)�”}”(hjyh]”hŒFedora”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khjwubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒUbuntu”h]”j)�”}”(hj�h]”hŒUbuntu”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KhjŽubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒOpenSUSE”h]”j)�”}”(hj§h]”hŒOpenSUSE”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒ Arch Linux”h]”j)�”}”(hj¾h]”hŒ Arch Linux”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒGentoo”h]”j)�”}”(hjÕh]”hŒGentoo”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K hjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒNetBSD”h]”j)�”}”(hjìh]”hŒNetBSD”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K!hjêubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubj_)�”}”(hŒFreeBSD ”h]”j)�”}”(hŒFreeBSD”h]”hŒFreeBSD”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K"hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj[ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jYh³hÇh´KhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jSh³hÇh´Khj&h²hubj)�”}”(hŒ°Some distribution packages are obsolete and it is recommended to use the latest version released from the Coccinelle homepage at https://coccinelle.gitlabpages.inria.fr/website”h]”(hŒ�Some distribution packages are obsolete and it is recommended to use the latest version released from the Coccinelle homepage at ”…”�”}”(hj'h²hh³Nh´NubhŒ reference”“”)�”}”(hŒ/https://coccinelle.gitlabpages.inria.fr/website”h]”hŒ/https://coccinelle.gitlabpages.inria.fr/website”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j3uh1j/hj'ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K$hj&h²hubj)�”}”(hŒOr from Github at:”h]”hŒOr from Github at:”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K(hj&h²hubj)�”}”(hŒ(https://github.com/coccinelle/coccinelle”h]”j0)�”}”(hjVh]”hŒ(https://github.com/coccinelle/coccinelle”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jVuh1j/hjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K*hj&h²hubj)�”}”(hŒ.Once you have it, run the following commands::”h]”hŒ-Once you have it, run the following commands:”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K,hj&h²hubhŒ literal_block”“”)�”}”(hŒ./autogen ./configure make”h]”hŒ./autogen ./configure make”…”�”}”hj|sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´K.hj&h²hubj)�”}”(hŒ(as a regular user, and install it with::”h]”hŒ'as a regular user, and install it with:”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K2hj&h²hubj{)�”}”(hŒsudo make install”h]”hŒsudo make install”…”�”}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´K4hj&h²hubj)�”}”(hŒMMore detailed installation instructions to build from source can be found at:”h]”hŒMMore detailed installation instructions to build from source can be found at:”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K6hj&h²hubj)�”}”(hŒ@https://github.com/coccinelle/coccinelle/blob/master/install.txt”h]”j0)�”}”(hj¶h]”hŒ@https://github.com/coccinelle/coccinelle/blob/master/install.txt”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j¶uh1j/hj´ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K9hj&h²hubeh}”(h]”Œgetting-coccinelle”ah ]”h"]”Œgetting coccinelle”ah$]”h&]”uh1jhjh²hh³hÇh´Kubj)�”}”(hhh]”(j)�”}”(hŒSupplemental documentation”h]”hŒSupplemental documentation”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÔh²hh³hÇh´KhjÔh²hubj)�”}”(hŒ/https://bottest.wiki.kernel.org/coccicheck.html”h]”j0)�”}”(hjõh]”hŒ/https://bottest.wiki.kernel.org/coccicheck.html”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jõuh1j/hjóubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K@hjÔh²hubj)�”}”(hŒMThe wiki documentation always refers to the linux-next version of the script.”h]”hŒMThe wiki documentation always refers to the linux-next version of the script.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KBhjÔh²hubj)�”}”(hŒAFor Semantic Patch Language(SmPL) grammar documentation refer to:”h]”hŒAFor Semantic Patch Language(SmPL) grammar documentation refer to:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KDhjÔh²hubj)�”}”(hŒFhttps://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar.html”h]”j0)�”}”(hj)h]”hŒFhttps://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar.html”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j)uh1j/hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KFhjÔh²hubeh}”(h]”Œsupplemental-documentation”ah ]”h"]”Œsupplemental documentation”ah$]”h&]”uh1jhjh²hh³hÇh´K``.”h]”(hŒFour basic modes are defined: ”…”�”}”(hjžh²hh³Nh´Nubja)�”}”(hŒ ``patch``”h]”hŒpatch”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjžubhŒ, ”…”�”}”(hjžh²hh³Nh´Nubja)�”}”(hŒ ``report``”h]”hŒreport”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjžubhŒ, ”…”�”}”hjžsbja)�”}”(hŒ ``context``”h]”hŒcontext”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjžubhŒ, and ”…”�”}”(hjžh²hh³Nh´Nubja)�”}”(hŒ``org``”h]”hŒorg”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjžubhŒA. The mode to use is specified by setting the MODE variable with ”…”�”}”(hjžh²hh³Nh´Nubja)�”}”(hŒ``MODE=``”h]”hŒ MODE=”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjžubhŒ.”…”�”}”(hjžh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KOhjGh²hubjZ)�”}”(hhh]”(j_)�”}”(hŒ)``patch`` proposes a fix, when possible. ”h]”j)�”}”(hŒ(``patch`` proposes a fix, when possible.”h]”(ja)�”}”(hŒ ``patch``”h]”hŒpatch”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj ubhŒ proposes a fix, when possible.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KShj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjh²hh³hÇh´Nubj_)�”}”(hŒV``report`` generates a list in the following format: file:line:column-column: message ”h]”j)�”}”(hŒU``report`` generates a list in the following format: file:line:column-column: message”h]”(ja)�”}”(hŒ ``report``”h]”hŒreport”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj3ubhŒ+ generates a list in the following format: ”…”�”}”(hj3h²hh³Nh´Nubj0)�”}”(hŒfile:line:column-column”h]”hŒfile:line:column-column”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jKuh1j/hj3ubhŒ : message”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KUhj/ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjh²hh³hÇh´Nubj_)�”}”(hŒ}``context`` highlights lines of interest and their context in a diff-like style. Lines of interest are indicated with ``-``. ”h]”j)�”}”(hŒ|``context`` highlights lines of interest and their context in a diff-like style. Lines of interest are indicated with ``-``.”h]”(ja)�”}”(hŒ ``context``”h]”hŒcontext”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjlubhŒk highlights lines of interest and their context in a diff-like style. Lines of interest are indicated with ”…”�”}”(hjlh²hh³Nh´Nubja)�”}”(hŒ``-``”h]”hŒ-”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjlubhŒ.”…”�”}”(hjlh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KXhjhubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjh²hh³hÇh´Nubj_)�”}”(hŒ<``org`` generates a report in the Org mode format of Emacs. ”h]”j)�”}”(hŒ;``org`` generates a report in the Org mode format of Emacs.”h]”(ja)�”}”(hŒ``org``”h]”hŒorg”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj¤ubhŒ4 generates a report in the Org mode format of Emacs.”…”�”}”(hj¤h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K[hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jj uh1jYh³hÇh´KShjGh²hubj)�”}”(hŒqNote that not all semantic patches implement all modes. For easy use of Coccinelle, the default mode is "report".”h]”hŒuNote that not all semantic patches implement all modes. For easy use of Coccinelle, the default mode is “reportâ€�.”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K]hjGh²hubj)�”}”(hŒ@Two other modes provide some common combinations of these modes.”h]”hŒ@Two other modes provide some common combinations of these modes.”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K`hjGh²hubjZ)�”}”(hhh]”(j_)�”}”(hŒJ``chain`` tries the previous modes in the order above until one succeeds. ”h]”j)�”}”(hŒI``chain`` tries the previous modes in the order above until one succeeds.”h]”(ja)�”}”(hŒ ``chain``”h]”hŒchain”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjïubhŒ@ tries the previous modes in the order above until one succeeds.”…”�”}”(hjïh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kbhjëubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjèh²hh³hÇh´Nubj_)�”}”(hŒ¢``rep+ctxt`` runs successively the report mode and the context mode. It should be used with the C option (described later) which checks the code on a file basis. ”h]”j)�”}”(hŒ¡``rep+ctxt`` runs successively the report mode and the context mode. It should be used with the C option (described later) which checks the code on a file basis.”h]”(ja)�”}”(hŒ ``rep+ctxt``”h]”hŒrep+ctxt”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjubhŒ• runs successively the report mode and the context mode. It should be used with the C option (described later) which checks the code on a file basis.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kdhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjèh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jj uh1jYh³hÇh´KbhjGh²hubj)�”}”(hhh]”(j)�”}”(hŒExamples”h]”hŒExamples”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj=h²hh³hÇh´Kiubj)�”}”(hŒFTo make a report for every semantic patch, run the following command::”h]”hŒETo make a report for every semantic patch, run the following command:”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kkhj=h²hubj{)�”}”(hŒmake coccicheck MODE=report”h]”hŒmake coccicheck MODE=report”…”�”}”hj\sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Kmhj=h²hubj)�”}”(hŒTo produce patches, run::”h]”hŒTo produce patches, run:”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kohj=h²hubj{)�”}”(hŒmake coccicheck MODE=patch”h]”hŒmake coccicheck MODE=patch”…”�”}”hjxsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Kqhj=h²hubj)�”}”(hŒ‰The coccicheck target applies every semantic patch available in the sub-directories of ``scripts/coccinelle`` to the entire Linux kernel.”h]”(hŒWThe coccicheck target applies every semantic patch available in the sub-directories of ”…”�”}”(hj†h²hh³Nh´Nubja)�”}”(hŒ``scripts/coccinelle``”h]”hŒscripts/coccinelle”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj†ubhŒ to the entire Linux kernel.”…”�”}”(hj†h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kthj=h²hubj)�”}”(hŒªFor each semantic patch, a commit message is proposed. It gives a description of the problem being checked by the semantic patch, and includes a reference to Coccinelle.”h]”hŒªFor each semantic patch, a commit message is proposed. It gives a description of the problem being checked by the semantic patch, and includes a reference to Coccinelle.”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kwhj=h²hubj)�”}”(hŒ…As with any static code analyzer, Coccinelle produces false positives. Thus, reports must be carefully checked, and patches reviewed.”h]”hŒ…As with any static code analyzer, Coccinelle produces false positives. Thus, reports must be carefully checked, and patches reviewed.”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K{hj=h²hubj)�”}”(hŒ=To enable verbose messages set the V= variable, for example::”h]”hŒ MODE=patch”h]”hŒ.make coccicheck COCCI= MODE=patch”…”�”}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´K­hj»h²hubj)�”}”(hŒor::”h]”hŒor:”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¯hj»h²hubj{)�”}”(hŒ/make coccicheck COCCI= MODE=report”h]”hŒ/make coccicheck COCCI= MODE=report”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´K±hj»h²hubeh}”(h]”Œ-using-coccinelle-with-a-single-semantic-patch”ah ]”h"]”Œ-using coccinelle with a single semantic patch”ah$]”h&]”uh1jhjh²hh³hÇh´K¥ubj)�”}”(hhh]”(j)�”}”(hŒ3Controlling Which Files are Processed by Coccinelle”h]”hŒ3Controlling Which Files are Processed by Coccinelle”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Kµubj)�”}”(hŒ4By default the entire kernel source tree is checked.”h]”hŒ4By default the entire kernel source tree is checked.”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K·hjh²hubj)�”}”(hŒ|To apply Coccinelle to a specific directory, ``M=`` can be used. For example, to check drivers/net/wireless/ one may write::”h]”(hŒ-To apply Coccinelle to a specific directory, ”…”�”}”(hj9h²hh³Nh´Nubja)�”}”(hŒ``M=``”h]”hŒM=”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj9ubhŒH can be used. For example, to check drivers/net/wireless/ one may write:”…”�”}”(hj9h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¹hjh²hubj{)�”}”(hŒ'make coccicheck M=drivers/net/wireless/”h]”hŒ'make coccicheck M=drivers/net/wireless/”…”�”}”hjYsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´K¼hjh²hubj)�”}”(hŒùTo apply Coccinelle on a file basis, instead of a directory basis, the C variable is used by the makefile to select which files to work with. This variable can be used to run scripts for the entire kernel, a specific directory, or for a single file.”h]”hŒùTo apply Coccinelle on a file basis, instead of a directory basis, the C variable is used by the makefile to select which files to work with. This variable can be used to run scripts for the entire kernel, a specific directory, or for a single file.”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¾hjh²hubj)�”}”(hŒ’For example, to check drivers/bluetooth/bfusb.c, the value 1 is passed to the C variable to check files that make considers need to be compiled.::”h]”hŒ‘For example, to check drivers/bluetooth/bfusb.c, the value 1 is passed to the C variable to check files that make considers need to be compiled.:”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÃhjh²hubj{)�”}”(hŒ;make C=1 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o”h]”hŒ;make C=1 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o”…”�”}”hjƒsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´KÇhjh²hubj)�”}”(hŒoThe value 2 is passed to the C variable to check files regardless of whether they need to be compiled or not.::”h]”hŒnThe value 2 is passed to the C variable to check files regardless of whether they need to be compiled or not.:”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÉhjh²hubj{)�”}”(hŒ;make C=2 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o”h]”hŒ;make C=2 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o”…”�”}”hjŸsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´KÌhjh²hubj)�”}”(hŒ…In these modes, which work on a file basis, there is no information about semantic patches displayed, and no commit message proposed.”h]”hŒ…In these modes, which work on a file basis, there is no information about semantic patches displayed, and no commit message proposed.”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÎhjh²hubj)�”}”(hŒ´This runs every semantic patch in scripts/coccinelle by default. The COCCI variable may additionally be used to only apply a single semantic patch as shown in the previous section.”h]”hŒ´This runs every semantic patch in scripts/coccinelle by default. The COCCI variable may additionally be used to only apply a single semantic patch as shown in the previous section.”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÑhjh²hubj)�”}”(hŒdThe "report" mode is the default. You can select another one with the MODE variable explained above.”h]”hŒhThe “reportâ€� mode is the default. You can select another one with the MODE variable explained above.”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÕhjh²hubeh}”(h]”Œ3controlling-which-files-are-processed-by-coccinelle”ah ]”h"]”Œ3controlling which files are processed by coccinelle”ah$]”h&]”uh1jhjh²hh³hÇh´Kµubj)�”}”(hhh]”(j)�”}”(hŒ!Debugging Coccinelle SmPL patches”h]”hŒ!Debugging Coccinelle SmPL patches”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjßh²hh³hÇh´KÙubj)�”}”(hŒüUsing coccicheck is best as it provides in the spatch command line include options matching the options used when we compile the kernel. You can learn what these options are by using V=1; you could then manually run Coccinelle with debug options added.”h]”hŒüUsing coccicheck is best as it provides in the spatch command line include options matching the options used when we compile the kernel. You can learn what these options are by using V=1; you could then manually run Coccinelle with debug options added.”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÛhjßh²hubj)�”}”(hX;An easier approach to debug running Coccinelle against SmPL patches is to ask coccicheck to redirect stderr to a debug file. As mentioned in the examples, by default stderr is redirected to /dev/null; if you'd like to capture stderr you can specify the ``DEBUG_FILE="file.txt"`` option to coccicheck. For instance::”h]”(hŒÿAn easier approach to debug running Coccinelle against SmPL patches is to ask coccicheck to redirect stderr to a debug file. As mentioned in the examples, by default stderr is redirected to /dev/null; if you’d like to capture stderr you can specify the ”…”�”}”(hjþh²hh³Nh´Nubja)�”}”(hŒ``DEBUG_FILE="file.txt"``”h]”hŒDEBUG_FILE="file.txt"”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjþubhŒ$ option to coccicheck. For instance:”…”�”}”(hjþh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kàhjßh²hubj{)�”}”(hŒxrm -f cocci.err make coccicheck COCCI=scripts/coccinelle/free/kfree.cocci MODE=report DEBUG_FILE=cocci.err cat cocci.err”h]”hŒxrm -f cocci.err make coccicheck COCCI=scripts/coccinelle/free/kfree.cocci MODE=report DEBUG_FILE=cocci.err cat cocci.err”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Kåhjßh²hubj)�”}”(hŒªYou can use SPFLAGS to add debugging flags; for instance you may want to add both ``--profile --show-trying`` to SPFLAGS when debugging. For example you may want to use::”h]”(hŒRYou can use SPFLAGS to add debugging flags; for instance you may want to add both ”…”�”}”(hj,h²hh³Nh´Nubja)�”}”(hŒ``--profile --show-trying``”h]”hŒ--profile --show-trying”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj,ubhŒ< to SPFLAGS when debugging. For example you may want to use:”…”�”}”(hj,h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kéhjßh²hubj{)�”}”(hŒ¨rm -f err.log export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci make coccicheck DEBUG_FILE="err.log" MODE=report SPFLAGS="--profile --show-trying" M=./drivers/mfd”h]”hŒ¨rm -f err.log export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci make coccicheck DEBUG_FILE="err.log" MODE=report SPFLAGS="--profile --show-trying" M=./drivers/mfd”…”�”}”hjLsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Kíhjßh²hubj)�”}”(hŒ‹err.log will now have the profiling information, while stdout will provide some progress information as Coccinelle moves forward with work.”h]”hŒ‹err.log will now have the profiling information, while stdout will provide some progress information as Coccinelle moves forward with work.”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kñhjßh²hubj)�”}”(hŒNOTE:”h]”hŒNOTE:”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kõhjßh²hubj)�”}”(hŒDDEBUG_FILE support is only supported when using coccinelle >= 1.0.2.”h]”hŒDDEBUG_FILE support is only supported when using coccinelle >= 1.0.2.”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K÷hjßh²hubj)�”}”(hŒøCurrently, DEBUG_FILE support is only available to check folders, and not single files. This is because checking a single file requires spatch to be called twice leading to DEBUG_FILE being set both times to the same value, giving rise to an error.”h]”hŒøCurrently, DEBUG_FILE support is only available to check folders, and not single files. This is because checking a single file requires spatch to be called twice leading to DEBUG_FILE being set both times to the same value, giving rise to an error.”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kùhjßh²hubeh}”(h]”Œ!debugging-coccinelle-smpl-patches”ah ]”h"]”Œ!debugging coccinelle smpl patches”ah$]”h&]”uh1jhjh²hh³hÇh´KÙubj)�”}”(hhh]”(j)�”}”(hŒ.cocciconfig support”h]”hŒ.cocciconfig support”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjšh²hh³hÇh´Kÿubj)�”}”(hŒ¿Coccinelle supports reading .cocciconfig for default Coccinelle options that should be used every time spatch is spawned. The order of precedence for variables for .cocciconfig is as follows:”h]”hŒ¿Coccinelle supports reading .cocciconfig for default Coccinelle options that should be used every time spatch is spawned. The order of precedence for variables for .cocciconfig is as follows:”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhjšh²hubjZ)�”}”(hhh]”(j_)�”}”(hŒ5Your current user's home directory is processed first”h]”j)�”}”(hj¾h]”hŒ7Your current user’s home directory is processed first”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hj¹h²hh³hÇh´Nubj_)�”}”(hŒ= 1.0.6. When no ID file is specified coccinelle assumes your ID database file is in the file .id-utils.index on the top level of the kernel. Coccinelle carries a script scripts/idutils_index.sh which creates the database with::”h]”hX Coccinelle supports idutils as well but requires coccinelle >= 1.0.6. When no ID file is specified coccinelle assumes your ID database file is in the file .id-utils.index on the top level of the kernel. Coccinelle carries a script scripts/idutils_index.sh which creates the database with:”…”�”}”(hjß h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M5hj² h²hubj{)�”}”(hŒ"mkid -i C --output .id-utils.index”h]”hŒ"mkid -i C --output .id-utils.index”…”�”}”hjí sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M:hj² h²hubj)�”}”(hŒRIf you have another database filename you can also just symlink with this name. ::”h]”hŒOIf you have another database filename you can also just symlink with this name.”…”�”}”(hjû h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M<hj² h²hubj{)�”}”(hŒ%make SPFLAGS=--use-idutils coccicheck”h]”hŒ%make SPFLAGS=--use-idutils coccicheck”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M?hj² h²hubj)�”}”(hŒNAlternatively you can specify the database filename explicitly, for instance::”h]”hŒMAlternatively you can specify the database filename explicitly, for instance:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MAhj² h²hubj{)�”}”(hŒ8make SPFLAGS="--use-idutils /full-path/to/ID" coccicheck”h]”hŒ8make SPFLAGS="--use-idutils /full-path/to/ID" coccicheck”…”�”}”hj% sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´MDhj² h²hubj)�”}”(hŒ9See ``spatch --help`` to learn more about spatch options.”h]”(hŒSee ”…”�”}”(hj3 h²hh³Nh´Nubja)�”}”(hŒ``spatch --help``”h]”hŒ spatch --help”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj3 ubhŒ$ to learn more about spatch options.”…”�”}”(hj3 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MFhj² h²hubj)�”}”(hX(Note that the ``--use-glimpse`` and ``--use-idutils`` options require external tools for indexing the code. None of them is thus active by default. However, by indexing the code with one of these tools, and according to the cocci file used, spatch could proceed the entire code base more quickly.”h]”(hŒNote that the ”…”�”}”(hjS h²hh³Nh´Nubja)�”}”(hŒ``--use-glimpse``”h]”hŒ --use-glimpse”…”�”}”(hj[ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjS ubhŒ and ”…”�”}”(hjS h²hh³Nh´Nubja)�”}”(hŒ``--use-idutils``”h]”hŒ --use-idutils”…”�”}”(hjm h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjS ubhŒó options require external tools for indexing the code. None of them is thus active by default. However, by indexing the code with one of these tools, and according to the cocci file used, spatch could proceed the entire code base more quickly.”…”�”}”(hjS h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MHhj² h²hubeh}”(h]”Œadditional-flags”ah ]”h"]”Œadditional flags”ah$]”h&]”uh1jhjh²hh³hÇh´M-ubj)�”}”(hhh]”(j)�”}”(hŒSmPL patch specific options”h]”hŒSmPL patch specific options”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj� h²hh³hÇh´MOubj)�”}”(hŒ¹SmPL patches can have their own requirements for options passed to Coccinelle. SmPL patch-specific options can be provided by providing them at the top of the SmPL patch, for instance::”h]”hŒ¸SmPL patches can have their own requirements for options passed to Coccinelle. SmPL patch-specific options can be provided by providing them at the top of the SmPL patch, for instance:”…”�”}”(hjž h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MQhj� h²hubj{)�”}”(hŒ+// Options: --no-includes --include-headers”h]”hŒ+// Options: --no-includes --include-headers”…”�”}”hj¬ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´MUhj� h²hubeh}”(h]”Œsmpl-patch-specific-options”ah ]”h"]”Œsmpl patch specific options”ah$]”h&]”uh1jhjh²hh³hÇh´MOubj)�”}”(hhh]”(j)�”}”(hŒ"SmPL patch Coccinelle requirements”h]”hŒ"SmPL patch Coccinelle requirements”…”�”}”(hjÅ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj h²hh³hÇh´MXubj)�”}”(hXAs Coccinelle features get added some more advanced SmPL patches may require newer versions of Coccinelle. If an SmPL patch requires a minimum version of Coccinelle, this can be specified as follows, as an example if requiring at least Coccinelle >= 1.0.5::”h]”hXAs Coccinelle features get added some more advanced SmPL patches may require newer versions of Coccinelle. If an SmPL patch requires a minimum version of Coccinelle, this can be specified as follows, as an example if requiring at least Coccinelle >= 1.0.5:”…”�”}”(hjÓ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MZhj h²hubj{)�”}”(hŒ// Requires: 1.0.5”h]”hŒ// Requires: 1.0.5”…”�”}”hjá sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M_hj h²hubeh}”(h]”Œ"smpl-patch-coccinelle-requirements”ah ]”h"]”Œ"smpl patch coccinelle requirements”ah$]”h&]”uh1jhjh²hh³hÇh´MXubj)�”}”(hhh]”(j)�”}”(hŒProposing new semantic patches”h]”hŒProposing new semantic patches”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj÷ h²hh³hÇh´Mbubj)�”}”(hŒ©New semantic patches can be proposed and submitted by kernel developers. For sake of clarity, they should be organized in the sub-directories of ``scripts/coccinelle/``.”h]”(hŒ‘New semantic patches can be proposed and submitted by kernel developers. For sake of clarity, they should be organized in the sub-directories of ”…”�”}”(hj h²hh³Nh´Nubja)�”}”(hŒ``scripts/coccinelle/``”h]”hŒscripts/coccinelle/”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj ubhŒ.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mdhj÷ h²hubeh}”(h]”Œproposing-new-semantic-patches”ah ]”h"]”Œproposing new semantic patches”ah$]”h&]”uh1jhjh²hh³hÇh´Mbubj)�”}”(hhh]”(j)�”}”(hŒ+Detailed description of the ``report`` mode”h]”(hŒDetailed description of the ”…”�”}”(hj3 h²hh³Nh´Nubja)�”}”(hŒ ``report``”h]”hŒreport”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj3 ubhŒ mode”…”�”}”(hj3 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj0 h²hh³hÇh´Mjubj)�”}”(hŒ5``report`` generates a list in the following format::”h]”(ja)�”}”(hŒ ``report``”h]”hŒreport”…”�”}”(hjW h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjS ubhŒ* generates a list in the following format:”…”�”}”(hjS h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mlhj0 h²hubj{)�”}”(hŒ file:line:column-column: message”h]”hŒ file:line:column-column: message”…”�”}”hjo sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Mnhj0 h²hubj)�”}”(hhh]”(j)�”}”(hŒExample”h]”hŒExample”…”�”}”(hj€ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj} h²hh³hÇh´Mqubj)�”}”(hŒ Running::”h]”hŒRunning:”…”�”}”(hjŽ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mshj} h²hubj{)�”}”(hŒGmake coccicheck MODE=report COCCI=scripts/coccinelle/api/err_cast.cocci”h]”hŒGmake coccicheck MODE=report COCCI=scripts/coccinelle/api/err_cast.cocci”…”�”}”hjœ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Muhj} h²hubj)�”}”(hŒ4will execute the following part of the SmPL script::”h]”hŒ3will execute the following part of the SmPL script:”…”�”}”(hjª h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mwhj} h²hubj{)�”}”(hX @r depends on !context && !patch && (org || report)@ expression x; position p; @@ ERR_PTR@p(PTR_ERR(x)) @script:python depends on report@ p << r.p; x << r.x; @@ msg="ERR_CAST can be used with %s" % (x) coccilib.report.print_report(p[0], msg) ”h]”hX @r depends on !context && !patch && (org || report)@ expression x; position p; @@ ERR_PTR@p(PTR_ERR(x)) @script:python depends on report@ p << r.p; x << r.x; @@ msg="ERR_CAST can be used with %s" % (x) coccilib.report.print_report(p[0], msg) ”…”�”}”hj¸ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Myhj} h²hubj)�”}”(hŒRThis SmPL excerpt generates entries on the standard output, as illustrated below::”h]”hŒQThis SmPL excerpt generates entries on the standard output, as illustrated below:”…”�”}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MŠhj} h²hubj{)�”}”(hŒÖ/home/user/linux/crypto/ctr.c:188:9-16: ERR_CAST can be used with alg /home/user/linux/crypto/authenc.c:619:9-16: ERR_CAST can be used with auth /home/user/linux/crypto/xts.c:227:9-16: ERR_CAST can be used with alg”h]”hŒÖ/home/user/linux/crypto/ctr.c:188:9-16: ERR_CAST can be used with alg /home/user/linux/crypto/authenc.c:619:9-16: ERR_CAST can be used with auth /home/user/linux/crypto/xts.c:227:9-16: ERR_CAST can be used with alg”…”�”}”hjÔ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M�hj} h²hubeh}”(h]”Œexample”ah ]”h"]”h$]”Œexample”ah&]”uh1jhj0 h²hh³hÇh´MqŒ referenced”Kubeh}”(h]”Œ'detailed-description-of-the-report-mode”ah ]”h"]”Œ'detailed description of the report mode”ah$]”h&]”uh1jhjh²hh³hÇh´Mjubj)�”}”(hhh]”(j)�”}”(hŒ*Detailed description of the ``patch`` mode”h]”(hŒDetailed description of the ”…”�”}”(hjö h²hh³Nh´Nubja)�”}”(hŒ ``patch``”h]”hŒpatch”…”�”}”(hjþ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjö ubhŒ mode”…”�”}”(hjö h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjó h²hh³hÇh´M“ubj)�”}”(hŒTWhen the ``patch`` mode is available, it proposes a fix for each problem identified.”h]”(hŒ When the ”…”�”}”(hj h²hh³Nh´Nubja)�”}”(hŒ ``patch``”h]”hŒpatch”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj ubhŒB mode is available, it proposes a fix for each problem identified.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M•hjó h²hubj)�”}”(hhh]”(j)�”}”(hŒExample”h]”hŒExample”…”�”}”(hj9 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj6 h²hh³hÇh´M™ubj)�”}”(hŒ Running::”h]”hŒRunning:”…”�”}”(hjG h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M›hj6 h²hubj{)�”}”(hŒFmake coccicheck MODE=patch COCCI=scripts/coccinelle/api/err_cast.cocci”h]”hŒFmake coccicheck MODE=patch COCCI=scripts/coccinelle/api/err_cast.cocci”…”�”}”hjU sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M�hj6 h²hubj)�”}”(hŒ4will execute the following part of the SmPL script::”h]”hŒ3will execute the following part of the SmPL script:”…”�”}”(hjc h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MŸhj6 h²hubj{)�”}”(hŒx @ depends on !context && patch && !org && !report @ expression x; @@ - ERR_PTR(PTR_ERR(x)) + ERR_CAST(x) ”h]”hŒx @ depends on !context && patch && !org && !report @ expression x; @@ - ERR_PTR(PTR_ERR(x)) + ERR_CAST(x) ”…”�”}”hjq sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M¡hj6 h²hubj)�”}”(hŒVThis SmPL excerpt generates patch hunks on the standard output, as illustrated below::”h]”hŒUThis SmPL excerpt generates patch hunks on the standard output, as illustrated below:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mªhj6 h²hubj{)�”}”(hXßdiff -u -p a/crypto/ctr.c b/crypto/ctr.c --- a/crypto/ctr.c 2010-05-26 10:49:38.000000000 +0200 +++ b/crypto/ctr.c 2010-06-03 23:44:49.000000000 +0200 @@ -185,7 +185,7 @@ static struct crypto_instance *crypto_ct alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); /* Block size must be >= 4 bytes. */ err = -EINVAL;”h]”hXßdiff -u -p a/crypto/ctr.c b/crypto/ctr.c --- a/crypto/ctr.c 2010-05-26 10:49:38.000000000 +0200 +++ b/crypto/ctr.c 2010-06-03 23:44:49.000000000 +0200 @@ -185,7 +185,7 @@ static struct crypto_instance *crypto_ct alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); /* Block size must be >= 4 bytes. */ err = -EINVAL;”…”�”}”hj� sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M­hj6 h²hubeh}”(h]”Œid1”ah ]”h"]”h$]”jè ah&]”uh1jhjó h²hh³hÇh´M™jê Kubeh}”(h]”Œ&detailed-description-of-the-patch-mode”ah ]”h"]”Œ&detailed description of the patch mode”ah$]”h&]”uh1jhjh²hh³hÇh´M“ubj)�”}”(hhh]”(j)�”}”(hŒ,Detailed description of the ``context`` mode”h]”(hŒDetailed description of the ”…”�”}”(hj­ h²hh³Nh´Nubja)�”}”(hŒ ``context``”h]”hŒcontext”…”�”}”(hjµ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj­ ubhŒ mode”…”�”}”(hj­ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjª h²hh³hÇh´M»ubj)�”}”(hŒP``context`` highlights lines of interest and their context in a diff-like style.”h]”(ja)�”}”(hŒ ``context``”h]”hŒcontext”…”�”}”(hjÑ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjÍ ubhŒE highlights lines of interest and their context in a diff-like style.”…”�”}”(hjÍ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M½hjª h²hubjT)�”}”(hX#**NOTE**: The diff-like output generated is NOT an applicable patch. The intent of the ``context`` mode is to highlight the important lines (annotated with minus, ``-``) and gives some surrounding context lines around. This output can be used with the diff mode of Emacs to review the code. ”h]”j)�”}”(hX"**NOTE**: The diff-like output generated is NOT an applicable patch. The intent of the ``context`` mode is to highlight the important lines (annotated with minus, ``-``) and gives some surrounding context lines around. This output can be used with the diff mode of Emacs to review the code.”h]”(hŒstrong”“”)�”}”(hŒ**NOTE**”h]”hŒNOTE”…”�”}”(hjó h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jñ hjí ubhŒO: The diff-like output generated is NOT an applicable patch. The intent of the ”…”�”}”(hjí h²hh³Nh´Nubja)�”}”(hŒ ``context``”h]”hŒcontext”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjí ubhŒA mode is to highlight the important lines (annotated with minus, ”…”�”}”(hjí h²hh³Nh´Nubja)�”}”(hŒ``-``”h]”hŒ-”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjí ubhŒz) and gives some surrounding context lines around. This output can be used with the diff mode of Emacs to review the code.”…”�”}”(hjí h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÀhjé ubah}”(h]”h ]”h"]”h$]”h&]”uh1jSh³hÇh´MÀhjª h²hubj)�”}”(hhh]”(j)�”}”(hŒExample”h]”hŒExample”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj5 h²hh³hÇh´MÇubj)�”}”(hŒ Running::”h]”hŒRunning:”…”�”}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÉhj5 h²hubj{)�”}”(hŒHmake coccicheck MODE=context COCCI=scripts/coccinelle/api/err_cast.cocci”h]”hŒHmake coccicheck MODE=context COCCI=scripts/coccinelle/api/err_cast.cocci”…”�”}”hjT sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´MËhj5 h²hubj)�”}”(hŒ4will execute the following part of the SmPL script::”h]”hŒ3will execute the following part of the SmPL script:”…”�”}”(hjb h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÍhj5 h²hubj{)�”}”(hŒi @ depends on context && !patch && !org && !report@ expression x; @@ * ERR_PTR(PTR_ERR(x)) ”h]”hŒi @ depends on context && !patch && !org && !report@ expression x; @@ * ERR_PTR(PTR_ERR(x)) ”…”�”}”hjp sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´MÏhj5 h²hubj)�”}”(hŒUThis SmPL excerpt generates diff hunks on the standard output, as illustrated below::”h]”hŒTThis SmPL excerpt generates diff hunks on the standard output, as illustrated below:”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M×hj5 h²hubj{)�”}”(hXµdiff -u -p /home/user/linux/crypto/ctr.c /tmp/nothing --- /home/user/linux/crypto/ctr.c 2010-05-26 10:49:38.000000000 +0200 +++ /tmp/nothing @@ -185,7 +185,6 @@ static struct crypto_instance *crypto_ct alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); /* Block size must be >= 4 bytes. */ err = -EINVAL;”h]”hXµdiff -u -p /home/user/linux/crypto/ctr.c /tmp/nothing --- /home/user/linux/crypto/ctr.c 2010-05-26 10:49:38.000000000 +0200 +++ /tmp/nothing @@ -185,7 +185,6 @@ static struct crypto_instance *crypto_ct alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); /* Block size must be >= 4 bytes. */ err = -EINVAL;”…”�”}”hjŒ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´MÚhj5 h²hubeh}”(h]”Œid2”ah ]”h"]”h$]”Œexample”ah&]”uh1jhjª h²hh³hÇh´MÇjê Kubeh}”(h]”Œ(detailed-description-of-the-context-mode”ah ]”h"]”Œ(detailed description of the context mode”ah$]”h&]”uh1jhjh²hh³hÇh´M»ubj)�”}”(hhh]”(j)�”}”(hŒ(Detailed description of the ``org`` mode”h]”(hŒDetailed description of the ”…”�”}”(hj­ h²hh³Nh´Nubja)�”}”(hŒ``org``”h]”hŒorg”…”�”}”(hjµ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hj­ ubhŒ mode”…”�”}”(hj­ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjª h²hh³hÇh´Mçubj)�”}”(hŒ;``org`` generates a report in the Org mode format of Emacs.”h]”(ja)�”}”(hŒ``org``”h]”hŒorg”…”�”}”(hjÑ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j`hjÍ ubhŒ4 generates a report in the Org mode format of Emacs.”…”�”}”(hjÍ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Méhjª h²hubj)�”}”(hhh]”(j)�”}”(hŒExample”h]”hŒExample”…”�”}”(hjì h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjé h²hh³hÇh´Mìubj)�”}”(hŒ Running::”h]”hŒRunning:”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mîhjé h²hubj{)�”}”(hŒDmake coccicheck MODE=org COCCI=scripts/coccinelle/api/err_cast.cocci”h]”hŒDmake coccicheck MODE=org COCCI=scripts/coccinelle/api/err_cast.cocci”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Mðhjé h²hubj)�”}”(hŒ4will execute the following part of the SmPL script::”h]”hŒ3will execute the following part of the SmPL script:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mòhjé h²hubj{)�”}”(hX2 @r depends on !context && !patch && (org || report)@ expression x; position p; @@ ERR_PTR@p(PTR_ERR(x)) @script:python depends on org@ p << r.p; x << r.x; @@ msg="ERR_CAST can be used with %s" % (x) msg_safe=msg.replace("[","@(").replace("]",")") coccilib.org.print_todo(p[0], msg_safe) ”h]”hX2 @r depends on !context && !patch && (org || report)@ expression x; position p; @@ ERR_PTR@p(PTR_ERR(x)) @script:python depends on org@ p << r.p; x << r.x; @@ msg="ERR_CAST can be used with %s" % (x) msg_safe=msg.replace("[","@(").replace("]",")") coccilib.org.print_todo(p[0], msg_safe) ”…”�”}”hj$sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´Môhjé h²hubj)�”}”(hŒVThis SmPL excerpt generates Org entries on the standard output, as illustrated below::”h]”hŒUThis SmPL excerpt generates Org entries on the standard output, as illustrated below:”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhjé h²hubj{)�”}”(hXl* TODO [[view:/home/user/linux/crypto/ctr.c::face=ovl-face1::linb=188::colb=9::cole=16][ERR_CAST can be used with alg]] * TODO [[view:/home/user/linux/crypto/authenc.c::face=ovl-face1::linb=619::colb=9::cole=16][ERR_CAST can be used with auth]] * TODO [[view:/home/user/linux/crypto/xts.c::face=ovl-face1::linb=227::colb=9::cole=16][ERR_CAST can be used with alg]]”h]”hXl* TODO [[view:/home/user/linux/crypto/ctr.c::face=ovl-face1::linb=188::colb=9::cole=16][ERR_CAST can be used with alg]] * TODO [[view:/home/user/linux/crypto/authenc.c::face=ovl-face1::linb=619::colb=9::cole=16][ERR_CAST can be used with auth]] * TODO [[view:/home/user/linux/crypto/xts.c::face=ovl-face1::linb=227::colb=9::cole=16][ERR_CAST can be used with alg]]”…”�”}”hj@sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jzh³hÇh´M hjé h²hubeh}”(h]”Œid3”ah ]”h"]”h$]”Œexample”ah&]”uh1jhjª h²hh³hÇh´Mìjê Kubeh}”(h]”Œ$detailed-description-of-the-org-mode”ah ]”h"]”Œ$detailed description of the org mode”ah$]”h&]”uh1jhjh²hh³hÇh´Mçubeh}”(h]”(Œ coccinelle”jeh ]”h"]”(Œ coccinelle”Œdevtools_coccinelle”eh$]”h&]”uh1jhhh²hh³hÇh´K Œexpect_referenced_by_name”}”jdhõsŒexpect_referenced_by_id”}”jhõsubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(jNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jŽŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”j]”hõasŒnameids”}”(jdjjcj`jÑjÎjDjAj5j2j-j*j¸jµjjjÜjÙj—j”j¯ j¬ jŠ j‡ j¿ j¼ jô jñ j- j* jð jí Œexample”Nj§ j¤ j§ j¤ j[jXuŒ nametypes”}”(jdˆjc‰jщjD‰j5‰j-‰j¸‰j‰j܉j—‰j¯ ‰jŠ ‰j¿ ‰jô ‰j- ‰jð ‰jÓ‰j§ ‰j§ ‰j[‰uh}”(jjj`jjÎj&jAjÔj2jGj*j=jµj8jj»jÙjj”jßj¬ jšj‡ j² j¼ j� jñ j j* j÷ jí j0 jä j} j¤ jó j� j6 j¤ jª jœ j5 jXjª jPjé uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jœKs…”R”Œparse_messages”]”(hŒsystem_message”“”)�”}”(hhh]”j)�”}”(hŒ*Duplicate implicit target name: "example".”h]”hŒ.Duplicate implicit target name: “exampleâ€�.”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjôubah}”(h]”h ]”h"]”h$]”h&]”j� aŒlevel”KŒtype”ŒINFO”Œsource”hÇŒline”M™uh1jòhj6 h²hh³hÇh´M™ubjó)�”}”(hhh]”j)�”}”(hŒ*Duplicate implicit target name: "example".”h]”hŒ.Duplicate implicit target name: “exampleâ€�.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”jœ aŒlevel”KŒtype”j Œsource”hÇŒline”MÇuh1jòhj5 h²hh³hÇh´MÇubjó)�”}”(hhh]”j)�”}”(hŒ*Duplicate implicit target name: "example".”h]”hŒ.Duplicate implicit target name: “exampleâ€�.”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj+ubah}”(h]”h ]”h"]”h$]”h&]”jPaŒlevel”KŒtype”j Œsource”hÇŒline”Mìuh1jòhjé h²hh³hÇh´MìubeŒtransform_messages”]”jó)�”}”(hhh]”j)�”}”(hhh]”hŒ9Hyperlink target "devtools-coccinelle" is not referenced.”…”�”•¹}”hjKsbah}”(h]”h ]”h"]”h$]”h&]”uh1jhjHubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j Œsource”hÇŒline”Kuh1jòubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.