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/dev-tools/checkpatchmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/zh_TW/dev-tools/checkpatchmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/it_IT/dev-tools/checkpatchmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ja_JP/dev-tools/checkpatchmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ko_KR/dev-tools/checkpatchmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/sp_SP/dev-tools/checkpatchmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h%SPDX-License-Identifier: GPL-2.0-onlyh]h%SPDX-License-Identifier: GPL-2.0-only}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhB/var/lib/git/docbuild/linux/Documentation/dev-tools/checkpatch.rsthKubhsection)}(hhh](htitle)}(h Checkpatchh]h Checkpatch}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hCheckpatch (scripts/checkpatch.pl) is a perl script which checks for trivial style violations in patches and optionally corrects them. Checkpatch can also be run on file contexts and without the kernel tree.h]hCheckpatch (scripts/checkpatch.pl) is a perl script which checks for trivial style violations in patches and optionally corrects them. Checkpatch can also be run on file contexts and without the kernel tree.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hCheckpatch is not always right. Your judgement takes precedence over checkpatch messages. If your code looks better with the violations, then its probably best left alone.h]hCheckpatch is not always right. Your judgement takes precedence over checkpatch messages. If your code looks better with the violations, then its probably best left alone.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(hOptionsh]hOptions}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hBThis section will describe the options checkpatch can be run with.h]hBThis section will describe the options checkpatch can be run with.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hUsage::h]hUsage:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(h-./scripts/checkpatch.pl [OPTION]... [FILE]...h]h-./scripts/checkpatch.pl [OPTION]... [FILE]...}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKhhhhubh)}(hAvailable options:h]hAvailable options:}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hX|- -q, --quiet Enable quiet mode. - -v, --verbose Enable verbose mode. Additional verbose test descriptions are output so as to provide information on why that particular message is shown. - --no-tree Run checkpatch without the kernel tree. - --no-signoff Disable the 'Signed-off-by' line check. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. Example:: Signed-off-by: Random J Developer Setting this flag effectively stops a message for a missing signed-off-by line in a patch context. - --patch Treat FILE as a patch. This is the default option and need not be explicitly specified. - --emacs Set output to emacs compile window format. This allows emacs users to jump from the error in the compile window directly to the offending line in the patch. - --terse Output only one line per report. - --showfile Show the diffed file position instead of the input file position. - -g, --git Treat FILE as a single commit or a git revision range. Single commit with: - - ^ - ~n Multiple commits with: - .. - ... - - - -f, --file Treat FILE as a regular source file. This option must be used when running checkpatch on source files in the kernel. - --subjective, --strict Enable stricter tests in checkpatch. By default the tests emitted as CHECK do not activate by default. Use this flag to activate the CHECK tests. - --list-types Every message emitted by checkpatch has an associated TYPE. Add this flag to display all the types in checkpatch. Note that when this flag is active, checkpatch does not read the input FILE, and no message is emitted. Only a list of types in checkpatch is output. - --types TYPE(,TYPE2...) Only display messages with the given types. Example:: ./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACES - --ignore TYPE(,TYPE2...) Checkpatch will not emit messages for the specified types. Example:: ./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACES - --show-types By default checkpatch doesn't display the type associated with the messages. Set this flag to show the message type in the output. - --max-line-length=n Set the max line length (default 100). If a line exceeds the specified length, a LONG_LINE message is emitted. The message level is different for patch and file contexts. For patches, a WARNING is emitted. While a milder CHECK is emitted for files. So for file contexts, the --strict flag must also be enabled. - --min-conf-desc-length=n Set the Kconfig entry minimum description length, if shorter, warn. - --tab-size=n Set the number of spaces for tab (default 8). - --root=PATH PATH to the kernel tree root. This option must be specified when invoking checkpatch from outside the kernel root. - --no-summary Suppress the per file summary. - --mailback Only produce a report in case of Warnings or Errors. Milder Checks are excluded from this. - --summary-file Include the filename in summary. - --debug KEY=[0|1] Turn on/off debugging of KEY, where KEY is one of 'values', 'possible', 'type', and 'attr' (default is all off). - --fix This is an EXPERIMENTAL feature. If correctable errors exist, a file .EXPERIMENTAL-checkpatch-fixes is created which has the automatically fixable errors corrected. - --fix-inplace EXPERIMENTAL - Similar to --fix but input file is overwritten with fixes. DO NOT USE this flag unless you are absolutely sure and you have a backup in place. - --ignore-perl-version Override checking of perl version. Runtime errors may be encountered after enabling this flag if the perl version does not meet the minimum specified. - --codespell Use the codespell dictionary for checking spelling errors. - --codespellfile Use the specified codespell file. Default is '/usr/share/codespell/dictionary.txt'. - --typedefsfile Read additional types from this file. - --color[=WHEN] Use colors 'always', 'never', or only when output is a terminal ('auto'). Default is 'auto'. - --kconfig-prefix=WORD Use WORD as a prefix for Kconfig symbols (default is `CONFIG_`). - -h, --help, --version Display the help text. h]h bullet_list)}(hhh](h list_item)}(h!-q, --quiet Enable quiet mode. h](h)}(h -q, --quieth]h -q, --quiet}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubh)}(hEnable quiet mode.h]hEnable quiet mode.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h-v, --verbose Enable verbose mode. Additional verbose test descriptions are output so as to provide information on why that particular message is shown. h]h)}(h-v, --verbose Enable verbose mode. Additional verbose test descriptions are output so as to provide information on why that particular message is shown.h]h-v, --verbose Enable verbose mode. Additional verbose test descriptions are output so as to provide information on why that particular message is shown.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjeubah}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h3--no-tree Run checkpatch without the kernel tree. h](h)}(h --no-treeh]h --no-tree}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hj}ubh)}(h'Run checkpatch without the kernel tree.h]h'Run checkpatch without the kernel tree.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hj}ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hX--no-signoff Disable the 'Signed-off-by' line check. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. Example:: Signed-off-by: Random J Developer Setting this flag effectively stops a message for a missing signed-off-by line in a patch context. h](h)}(h --no-signoffh]h --no-signoff}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubh)}(hDisable the 'Signed-off-by' line check. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch.h]hDisable the ‘Signed-off-by’ line check. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjubj)}(h@Signed-off-by: Random J Developer h]h@Signed-off-by: Random J Developer }hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK/hjubh)}(hbSetting this flag effectively stops a message for a missing signed-off-by line in a patch context.h]hbSetting this flag effectively stops a message for a missing signed-off-by line in a patch context.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hb--patch Treat FILE as a patch. This is the default option and need not be explicitly specified. h](h)}(h--patchh]h--patch}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubh)}(hXTreat FILE as a patch. This is the default option and need not be explicitly specified.h]hXTreat FILE as a patch. This is the default option and need not be explicitly specified.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--emacs Set output to emacs compile window format. This allows emacs users to jump from the error in the compile window directly to the offending line in the patch. h](h)}(h--emacsh]h--emacs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjubh)}(hSet output to emacs compile window format. This allows emacs users to jump from the error in the compile window directly to the offending line in the patch.h]hSet output to emacs compile window format. This allows emacs users to jump from the error in the compile window directly to the offending line in the patch.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h*--terse Output only one line per report. h](h)}(h--terseh]h--terse}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hj?ubh)}(h Output only one line per report.h]h Output only one line per report.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhj?ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hN--showfile Show the diffed file position instead of the input file position. h](h)}(h --showfileh]h --showfile}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjeubh)}(hAShow the diffed file position instead of the input file position.h]hAShow the diffed file position instead of the input file position.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjeubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h-g, --git Treat FILE as a single commit or a git revision range. Single commit with: - - ^ - ~n Multiple commits with: - .. - ... - - h](h)}(h -g, --gith]h -g, --git}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubh)}(h6Treat FILE as a single commit or a git revision range.h]h6Treat FILE as a single commit or a git revision range.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjubh)}(hSingle commit with:h]hSingle commit with:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjubj9)}(hhh](j>)}(hh]h)}(hjh]h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjubah}(h]h ]h"]h$]h&]uh1j=hjubj>)}(h^h]h)}(hjh]h^}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1j=hjubj>)}(h~n h]h)}(h~nh]h~n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKOhjubah}(h]h ]h"]h$]h&]uh1j=hjubeh}(h]h ]h"]h$]h&]bullet-uh1j8hhhKMhjubh)}(hMultiple commits with:h]hMultiple commits with:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjubj9)}(hhh](j>)}(h..h]h)}(hjh]h..}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjubah}(h]h ]h"]h$]h&]uh1j=hjubj>)}(h...h]h)}(hj4h]h...}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThj2ubah}(h]h ]h"]h$]h&]uh1j=hjubj>)}(h- h]h)}(h -h]h -}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjIubah}(h]h ]h"]h$]h&]uh1j=hjubeh}(h]h ]h"]h$]h&]jj uh1j8hhhKShjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h-f, --file Treat FILE as a regular source file. This option must be used when running checkpatch on source files in the kernel. h](h)}(h -f, --fileh]h -f, --file}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjmubh)}(huTreat FILE as a regular source file. This option must be used when running checkpatch on source files in the kernel.h]huTreat FILE as a regular source file. This option must be used when running checkpatch on source files in the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjmubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--subjective, --strict Enable stricter tests in checkpatch. By default the tests emitted as CHECK do not activate by default. Use this flag to activate the CHECK tests. h](h)}(h--subjective, --stricth]h--subjective, --strict}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjubh)}(hEnable stricter tests in checkpatch. By default the tests emitted as CHECK do not activate by default. Use this flag to activate the CHECK tests.h]hEnable stricter tests in checkpatch. By default the tests emitted as CHECK do not activate by default. Use this flag to activate the CHECK tests.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hX--list-types Every message emitted by checkpatch has an associated TYPE. Add this flag to display all the types in checkpatch. Note that when this flag is active, checkpatch does not read the input FILE, and no message is emitted. Only a list of types in checkpatch is output. h](h)}(h --list-typesh]h --list-types}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubh)}(hrEvery message emitted by checkpatch has an associated TYPE. Add this flag to display all the types in checkpatch.h]hrEvery message emitted by checkpatch has an associated TYPE. Add this flag to display all the types in checkpatch.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjubh)}(hNote that when this flag is active, checkpatch does not read the input FILE, and no message is emitted. Only a list of types in checkpatch is output.h]hNote that when this flag is active, checkpatch does not read the input FILE, and no message is emitted. Only a list of types in checkpatch is output.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--types TYPE(,TYPE2...) Only display messages with the given types. Example:: ./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACES h](h)}(h--types TYPE(,TYPE2...)h]h--types TYPE(,TYPE2...)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjubh)}(h+Only display messages with the given types.h]h+Only display messages with the given types.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjubh)}(h Example::h]hExample:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubj)}(hB./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACESh]hB./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACES}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKohjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--ignore TYPE(,TYPE2...) Checkpatch will not emit messages for the specified types. Example:: ./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACES h](h)}(h--ignore TYPE(,TYPE2...)h]h--ignore TYPE(,TYPE2...)}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhj/ubh)}(h:Checkpatch will not emit messages for the specified types.h]h:Checkpatch will not emit messages for the specified types.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshj/ubh)}(h Example::h]hExample:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhj/ubj)}(hC./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACESh]hC./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACES}hj]sbah}(h]h ]h"]h$]h&]hhuh1jhhhKwhj/ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--show-types By default checkpatch doesn't display the type associated with the messages. Set this flag to show the message type in the output. h](h)}(h --show-typesh]h --show-types}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjqubh)}(hBy default checkpatch doesn't display the type associated with the messages. Set this flag to show the message type in the output.h]hBy default checkpatch doesn’t display the type associated with the messages. Set this flag to show the message type in the output.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hjqubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hXR--max-line-length=n Set the max line length (default 100). If a line exceeds the specified length, a LONG_LINE message is emitted. The message level is different for patch and file contexts. For patches, a WARNING is emitted. While a milder CHECK is emitted for files. So for file contexts, the --strict flag must also be enabled. h](h)}(h--max-line-length=nh]h--max-line-length=n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubh)}(hoSet the max line length (default 100). If a line exceeds the specified length, a LONG_LINE message is emitted.h]hoSet the max line length (default 100). If a line exceeds the specified length, a LONG_LINE message is emitted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hThe message level is different for patch and file contexts. For patches, a WARNING is emitted. While a milder CHECK is emitted for files. So for file contexts, the --strict flag must also be enabled.h]hThe message level is different for patch and file contexts. For patches, a WARNING is emitted. While a milder CHECK is emitted for files. So for file contexts, the --strict flag must also be enabled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h^--min-conf-desc-length=n Set the Kconfig entry minimum description length, if shorter, warn. h](h)}(h--min-conf-desc-length=nh]h--min-conf-desc-length=n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hCSet the Kconfig entry minimum description length, if shorter, warn.h]hCSet the Kconfig entry minimum description length, if shorter, warn.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h<--tab-size=n Set the number of spaces for tab (default 8). h](h)}(h --tab-size=nh]h --tab-size=n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h-Set the number of spaces for tab (default 8).h]h-Set the number of spaces for tab (default 8).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--root=PATH PATH to the kernel tree root. This option must be specified when invoking checkpatch from outside the kernel root. h](h)}(h --root=PATHh]h --root=PATH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hPATH to the kernel tree root.h]hPATH to the kernel tree root.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hTThis option must be specified when invoking checkpatch from outside the kernel root.h]hTThis option must be specified when invoking checkpatch from outside the kernel root.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h---no-summary Suppress the per file summary. h](h)}(h --no-summaryh]h --no-summary}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjKubh)}(hSuppress the per file summary.h]hSuppress the per file summary.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjKubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hh--mailback Only produce a report in case of Warnings or Errors. Milder Checks are excluded from this. h](h)}(h --mailbackh]h --mailback}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjqubh)}(h[Only produce a report in case of Warnings or Errors. Milder Checks are excluded from this.h]h[Only produce a report in case of Warnings or Errors. Milder Checks are excluded from this.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjqubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h1--summary-file Include the filename in summary. h](h)}(h--summary-fileh]h--summary-file}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h Include the filename in summary.h]h Include the filename in summary.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--debug KEY=[0|1] Turn on/off debugging of KEY, where KEY is one of 'values', 'possible', 'type', and 'attr' (default is all off). h](h)}(h--debug KEY=[0|1]h]h--debug KEY=[0|1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hpTurn on/off debugging of KEY, where KEY is one of 'values', 'possible', 'type', and 'attr' (default is all off).h]hTurn on/off debugging of KEY, where KEY is one of ‘values’, ‘possible’, ‘type’, and ‘attr’ (default is all off).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--fix This is an EXPERIMENTAL feature. If correctable errors exist, a file .EXPERIMENTAL-checkpatch-fixes is created which has the automatically fixable errors corrected. h](h)}(h--fixh]h--fix}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hThis is an EXPERIMENTAL feature. If correctable errors exist, a file .EXPERIMENTAL-checkpatch-fixes is created which has the automatically fixable errors corrected.h]hThis is an EXPERIMENTAL feature. If correctable errors exist, a file .EXPERIMENTAL-checkpatch-fixes is created which has the automatically fixable errors corrected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--fix-inplace EXPERIMENTAL - Similar to --fix but input file is overwritten with fixes. DO NOT USE this flag unless you are absolutely sure and you have a backup in place. h](h)}(h --fix-inplaceh]h --fix-inplace}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hIEXPERIMENTAL - Similar to --fix but input file is overwritten with fixes.h]hIEXPERIMENTAL - Similar to --fix but input file is overwritten with fixes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hSDO NOT USE this flag unless you are absolutely sure and you have a backup in place.h]hSDO NOT USE this flag unless you are absolutely sure and you have a backup in place.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h--ignore-perl-version Override checking of perl version. Runtime errors may be encountered after enabling this flag if the perl version does not meet the minimum specified. h](h)}(h--ignore-perl-versionh]h--ignore-perl-version}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj=ubh)}(hOverride checking of perl version. Runtime errors may be encountered after enabling this flag if the perl version does not meet the minimum specified.h]hOverride checking of perl version. Runtime errors may be encountered after enabling this flag if the perl version does not meet the minimum specified.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj=ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hH--codespell Use the codespell dictionary for checking spelling errors. h](h)}(h --codespellh]h --codespell}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubh)}(h:Use the codespell dictionary for checking spelling errors.h]h:Use the codespell dictionary for checking spelling errors.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(he--codespellfile Use the specified codespell file. Default is '/usr/share/codespell/dictionary.txt'. h](h)}(h--codespellfileh]h--codespellfile}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hSUse the specified codespell file. Default is '/usr/share/codespell/dictionary.txt'.h]hWUse the specified codespell file. Default is ‘/usr/share/codespell/dictionary.txt’.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h6--typedefsfile Read additional types from this file. h](h)}(h--typedefsfileh]h--typedefsfile}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h%Read additional types from this file.h]h%Read additional types from this file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hm--color[=WHEN] Use colors 'always', 'never', or only when output is a terminal ('auto'). Default is 'auto'. h](h)}(h--color[=WHEN]h]h--color[=WHEN]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h\Use colors 'always', 'never', or only when output is a terminal ('auto'). Default is 'auto'.h]hlUse colors ‘always’, ‘never’, or only when output is a terminal (‘auto’). Default is ‘auto’.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hX--kconfig-prefix=WORD Use WORD as a prefix for Kconfig symbols (default is `CONFIG_`). h](h)}(h--kconfig-prefix=WORDh]h--kconfig-prefix=WORD}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h@Use WORD as a prefix for Kconfig symbols (default is `CONFIG_`).h](h5Use WORD as a prefix for Kconfig symbols (default is }(hj hhhNhNubhtitle_reference)}(h `CONFIG_`h]hCONFIG_}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(h.-h, --help, --version Display the help text. h](h)}(h-h, --help, --versionh]h-h, --help, --version}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5ubh)}(hDisplay the help text.h]hDisplay the help text.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5ubeh}(h]h ]h"]h$]h&]uh1j=hj:ubeh}(h]h ]h"]h$]h&]jj uh1j8hhhKhj4ubah}(h]h ]h"]h$]h&]uh1j2hhhKhhhhubeh}(h]optionsah ]h"]optionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hMessage Levelsh]hMessage Levels}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohhhhhKubh)}(hMessages in checkpatch are divided into three levels. The levels of messages in checkpatch denote the severity of the error. They are:h]hMessages in checkpatch are divided into three levels. The levels of messages in checkpatch denote the severity of the error. They are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjohhubj3)}(hXy- ERROR This is the most strict level. Messages of type ERROR must be taken seriously as they denote things that are very likely to be wrong. - WARNING This is the next stricter level. Messages of type WARNING requires a more careful review. But it is milder than an ERROR. - CHECK This is the mildest level. These are things which may require some thought. h]j9)}(hhh](j>)}(hERROR This is the most strict level. Messages of type ERROR must be taken seriously as they denote things that are very likely to be wrong. h](h)}(hERRORh]hERROR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hThis is the most strict level. Messages of type ERROR must be taken seriously as they denote things that are very likely to be wrong.h]hThis is the most strict level. Messages of type ERROR must be taken seriously as they denote things that are very likely to be wrong.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hjubj>)}(hWARNING This is the next stricter level. Messages of type WARNING requires a more careful review. But it is milder than an ERROR. h](h)}(hWARNINGh]hWARNING}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h{This is the next stricter level. Messages of type WARNING requires a more careful review. But it is milder than an ERROR.h]h{This is the next stricter level. Messages of type WARNING requires a more careful review. But it is milder than an ERROR.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hjubj>)}(hTCHECK This is the mildest level. These are things which may require some thought. h](h)}(hCHECKh]hCHECK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hLThis is the mildest level. These are things which may require some thought.h]hLThis is the mildest level. These are things which may require some thought.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j=hjubeh}(h]h ]h"]h$]h&]jj uh1j8hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hhhKhjohhubeh}(h]message-levelsah ]h"]message levelsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hType Descriptionsh]hType Descriptions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hKThis section contains a description of all the message types in checkpatch.h]hKThis section contains a description of all the message types in checkpatch.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h4Types in this section are also parsed by checkpatch.h]h4Types in this section are also parsed by checkpatch.}hj:sbah}(h]h ]h"]h$]h&]hhuh1hhjhhhhhKubh)}(h4The types are grouped into subsections based on use.h]h4The types are grouped into subsections based on use.}hjHsbah}(h]h ]h"]h$]h&]hhuh1hhjhhhhhKubh)}(hhh](h)}(hAllocation styleh]hAllocation style}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhhhhhKubj3)}(hX**ALLOC_ARRAY_ARGS** The first argument for kcalloc or kmalloc_array should be the number of elements. sizeof() as the first argument is generally wrong. See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html **ALLOC_SIZEOF_STRUCT** The allocation style is bad. In general for family of allocation functions using sizeof() to get memory size, constructs like:: p = alloc(sizeof(struct foo), ...) should be:: p = alloc(sizeof(*p), ...) See: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory **ALLOC_WITH_MULTIPLY** Prefer kmalloc_array/kcalloc over kmalloc/kzalloc with a sizeof multiply. See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html h]hdefinition_list)}(hhh](hdefinition_list_item)}(h**ALLOC_ARRAY_ARGS** The first argument for kcalloc or kmalloc_array should be the number of elements. sizeof() as the first argument is generally wrong. See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html h](hterm)}(h**ALLOC_ARRAY_ARGS**h]hstrong)}(hjzh]hALLOC_ARRAY_ARGS}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjxubah}(h]h ]h"]h$]h&]uh1jvhhhKhjrubh definition)}(hhh](h)}(hThe first argument for kcalloc or kmalloc_array should be the number of elements. sizeof() as the first argument is generally wrong.h]hThe first argument for kcalloc or kmalloc_array should be the number of elements. sizeof() as the first argument is generally wrong.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hKSee: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.htmlh](hSee: }(hjhhhNhNubh reference)}(hFhttps://www.kernel.org/doc/html/latest/core-api/memory-allocation.htmlh]hFhttps://www.kernel.org/doc/html/latest/core-api/memory-allocation.html}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]uh1jphhhKhjmubjq)}(hXC**ALLOC_SIZEOF_STRUCT** The allocation style is bad. In general for family of allocation functions using sizeof() to get memory size, constructs like:: p = alloc(sizeof(struct foo), ...) should be:: p = alloc(sizeof(*p), ...) See: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory h](jw)}(h**ALLOC_SIZEOF_STRUCT**h]j})}(hjh]hALLOC_SIZEOF_STRUCT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh](h)}(hThe allocation style is bad. In general for family of allocation functions using sizeof() to get memory size, constructs like::h]hThe allocation style is bad. In general for family of allocation functions using sizeof() to get memory size, constructs like:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(h"p = alloc(sizeof(struct foo), ...)h]h"p = alloc(sizeof(struct foo), ...)}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(h should be::h]h should be:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hp = alloc(sizeof(*p), ...)h]hp = alloc(sizeof(*p), ...)}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hWSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memoryh](hSee: }(hj% hhhNhNubj)}(hRhttps://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memoryh]hRhttps://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory}(hj- hhhNhNubah}(h]h ]h"]h$]h&]refurij/ uh1jhj% ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhjmubjq)}(h**ALLOC_WITH_MULTIPLY** Prefer kmalloc_array/kcalloc over kmalloc/kzalloc with a sizeof multiply. See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html h](jw)}(h**ALLOC_WITH_MULTIPLY**h]j})}(hjT h]hALLOC_WITH_MULTIPLY}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjR ubah}(h]h ]h"]h$]h&]uh1jvhhhMhjN ubj)}(hhh](h)}(hIPrefer kmalloc_array/kcalloc over kmalloc/kzalloc with a sizeof multiply.h]hIPrefer kmalloc_array/kcalloc over kmalloc/kzalloc with a sizeof multiply.}(hjl hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hji ubh)}(hKSee: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.htmlh](hSee: }(hjz hhhNhNubj)}(hFhttps://www.kernel.org/doc/html/latest/core-api/memory-allocation.htmlh]hFhttps://www.kernel.org/doc/html/latest/core-api/memory-allocation.html}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhjz ubeh}(h]h ]h"]h$]h&]uh1hhhhM hji ubeh}(h]h ]h"]h$]h&]uh1jhjN ubeh}(h]h ]h"]h$]h&]uh1jphhhMhjmubeh}(h]h ]h"]h$]h&]uh1jkhjgubah}(h]h ]h"]h$]h&]uh1j2hhhKhjVhhubeh}(h]allocation-styleah ]h"]allocation styleah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h API usageh]h API usage}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubj3)}(hXm**ARCH_DEFINES** Architecture specific defines should be avoided wherever possible. **ARCH_INCLUDE_LINUX** Whenever asm/file.h is included and linux/file.h exists, a conversion can be made when linux/file.h includes asm/file.h. However this is not always the case (See signal.h). This message type is emitted only for includes from arch/. **AVOID_BUG** BUG() or BUG_ON() should be avoided totally. Use WARN() and WARN_ON() instead, and handle the "impossible" error condition as gracefully as possible. See: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on **CONSIDER_KSTRTO** The simple_strtol(), simple_strtoll(), simple_strtoul(), and simple_strtoull() functions explicitly ignore overflows, which may lead to unexpected results in callers. The respective kstrtol(), kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the correct replacements. See: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull **CONSTANT_CONVERSION** Use of __constant_ form is discouraged for the following functions:: __constant_cpu_to_be[x] __constant_cpu_to_le[x] __constant_be[x]_to_cpu __constant_le[x]_to_cpu __constant_htons __constant_ntohs Using any of these outside of include/uapi/ is not preferred as using the function without __constant_ is identical when the argument is a constant. In big endian systems, the macros like __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to the same expression:: #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) #define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) In little endian systems, the macros __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to __constant_swab32 and __swab32. __swab32 has a __builtin_constant_p check:: #define __swab32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___constant_swab32(x) : \ __fswab32(x)) So ultimately they have a special case for constants. Similar is the case with all of the macros in the list. Thus using the __constant_... forms are unnecessarily verbose and not preferred outside of include/uapi. See: https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/ **DEPRECATED_API** Usage of a deprecated RCU API is detected. It is recommended to replace old flavourful RCU APIs by their new vanilla-RCU counterparts. The full list of available RCU APIs can be viewed from the kernel docs. See: https://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apis **DEVICE_ATTR_FUNCTIONS** The function names used in DEVICE_ATTR is unusual. Typically, the store and show functions are used with _store and _show, where is a named attribute variable of the device. Consider the following examples:: static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(power, 0644, power_show, power_store); The function names should preferably follow the above pattern. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes **DEVICE_ATTR_RO** The DEVICE_ATTR_RO(name) helper macro can be used instead of DEVICE_ATTR(name, 0444, name_show, NULL); Note that the macro automatically appends _show to the named attribute variable of the device for the show method. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes **DEVICE_ATTR_RW** The DEVICE_ATTR_RW(name) helper macro can be used instead of DEVICE_ATTR(name, 0644, name_show, name_store); Note that the macro automatically appends _show and _store to the named attribute variable of the device for the show and store methods. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes **DEVICE_ATTR_WO** The DEVICE_AATR_WO(name) helper macro can be used instead of DEVICE_ATTR(name, 0200, NULL, name_store); Note that the macro automatically appends _store to the named attribute variable of the device for the store method. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes **DUPLICATED_SYSCTL_CONST** Commit d91bff3011cf ("proc/sysctl: add shared variables for range check") added some shared const variables to be used instead of a local copy in each source file. Consider replacing the sysctl range checking value with the shared one in include/linux/sysctl.h. The following conversion scheme may be used:: &zero -> SYSCTL_ZERO &one -> SYSCTL_ONE &int_max -> SYSCTL_INT_MAX See: 1. https://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/ 2. https://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/ **ENOSYS** ENOSYS means that a nonexistent system call was called. Earlier, it was wrongly used for things like invalid operations on otherwise valid syscalls. This should be avoided in new code. See: https://lore.kernel.org/lkml/5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net/ **ENOTSUPP** ENOTSUPP is not a standard error code and should be avoided in new patches. EOPNOTSUPP should be used instead. See: https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/ **EXPORT_SYMBOL** EXPORT_SYMBOL should immediately follow the symbol to be exported. **IN_ATOMIC** in_atomic() is not for driver use so any such use is reported as an ERROR. Also in_atomic() is often used to determine if sleeping is permitted, but it is not reliable in this use model. Therefore its use is strongly discouraged. However, in_atomic() is ok for core kernel use. See: https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/ **LOCKDEP** The lockdep_no_validate class was added as a temporary measure to prevent warnings on conversion of device->sem to device->mutex. It should not be used for any other purpose. See: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/ **MALFORMED_INCLUDE** The #include statement has a malformed path. This has happened because the author has included a double slash "//" in the pathname accidentally. **USE_LOCKDEP** lockdep_assert_held() annotations should be preferred over assertions based on spin_is_locked() See: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations **UAPI_INCLUDE** No #include statements in include/uapi should use a uapi/ path. **USLEEP_RANGE** usleep_range() should be preferred over udelay(). The proper way of using usleep_range() is mentioned in the kernel docs. h]jl)}(hhh](jq)}(hT**ARCH_DEFINES** Architecture specific defines should be avoided wherever possible. h](jw)}(h**ARCH_DEFINES**h]j})}(hj h]h ARCH_DEFINES}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMhj ubj)}(hhh]h)}(hBArchitecture specific defines should be avoided wherever possible.h]hBArchitecture specific defines should be avoided wherever possible.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**ARCH_INCLUDE_LINUX** Whenever asm/file.h is included and linux/file.h exists, a conversion can be made when linux/file.h includes asm/file.h. However this is not always the case (See signal.h). This message type is emitted only for includes from arch/. h](jw)}(h**ARCH_INCLUDE_LINUX**h]j})}(hj h]hARCH_INCLUDE_LINUX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMhj ubj)}(hhh]h)}(hWhenever asm/file.h is included and linux/file.h exists, a conversion can be made when linux/file.h includes asm/file.h. However this is not always the case (See signal.h). This message type is emitted only for includes from arch/.h]hWhenever asm/file.h is included and linux/file.h exists, a conversion can be made when linux/file.h includes asm/file.h. However this is not always the case (See signal.h). This message type is emitted only for includes from arch/.}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj" ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**AVOID_BUG** BUG() or BUG_ON() should be avoided totally. Use WARN() and WARN_ON() instead, and handle the "impossible" error condition as gracefully as possible. See: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on h](jw)}(h **AVOID_BUG**h]j})}(hjE h]h AVOID_BUG}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjC ubah}(h]h ]h"]h$]h&]uh1jvhhhM"hj? ubj)}(hhh](h)}(hBUG() or BUG_ON() should be avoided totally. Use WARN() and WARN_ON() instead, and handle the "impossible" error condition as gracefully as possible.h]hBUG() or BUG_ON() should be avoided totally. Use WARN() and WARN_ON() instead, and handle the “impossible” error condition as gracefully as possible.}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ ubh)}(hRSee: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-onh](hSee: }(hjk hhhNhNubj)}(hMhttps://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-onh]hMhttps://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on}(hjs hhhNhNubah}(h]h ]h"]h$]h&]refuriju uh1jhjk ubeh}(h]h ]h"]h$]h&]uh1hhhhM"hjZ ubeh}(h]h ]h"]h$]h&]uh1jhj? ubeh}(h]h ]h"]h$]h&]uh1jphhhM"hj ubjq)}(hX**CONSIDER_KSTRTO** The simple_strtol(), simple_strtoll(), simple_strtoul(), and simple_strtoull() functions explicitly ignore overflows, which may lead to unexpected results in callers. The respective kstrtol(), kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the correct replacements. See: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull h](jw)}(h**CONSIDER_KSTRTO**h]j})}(hj h]hCONSIDER_KSTRTO}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhM+hj ubj)}(hhh](h)}(hXThe simple_strtol(), simple_strtoll(), simple_strtoul(), and simple_strtoull() functions explicitly ignore overflows, which may lead to unexpected results in callers. The respective kstrtol(), kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the correct replacements.h]hXThe simple_strtol(), simple_strtoll(), simple_strtoul(), and simple_strtoull() functions explicitly ignore overflows, which may lead to unexpected results in callers. The respective kstrtol(), kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the correct replacements.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj ubh)}(hSee: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoullh](hSee: }(hj hhhNhNubj)}(hzhttps://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoullh]hzhttps://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhM+hj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhM+hj ubjq)}(hX**CONSTANT_CONVERSION** Use of __constant_ form is discouraged for the following functions:: __constant_cpu_to_be[x] __constant_cpu_to_le[x] __constant_be[x]_to_cpu __constant_le[x]_to_cpu __constant_htons __constant_ntohs Using any of these outside of include/uapi/ is not preferred as using the function without __constant_ is identical when the argument is a constant. In big endian systems, the macros like __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to the same expression:: #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) #define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) In little endian systems, the macros __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to __constant_swab32 and __swab32. __swab32 has a __builtin_constant_p check:: #define __swab32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___constant_swab32(x) : \ __fswab32(x)) So ultimately they have a special case for constants. Similar is the case with all of the macros in the list. Thus using the __constant_... forms are unnecessarily verbose and not preferred outside of include/uapi. See: https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/ h](jw)}(h**CONSTANT_CONVERSION**h]j})}(hj h]hCONSTANT_CONVERSION}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMOhj ubj)}(hhh](h)}(hIUse of __constant_ form is discouraged for the following functions::h]hHUse of __constant_ form is discouraged for the following functions:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hj ubj)}(h__constant_cpu_to_be[x] __constant_cpu_to_le[x] __constant_be[x]_to_cpu __constant_le[x]_to_cpu __constant_htons __constant_ntohsh]h__constant_cpu_to_be[x] __constant_cpu_to_le[x] __constant_be[x]_to_cpu __constant_le[x]_to_cpu __constant_htons __constant_ntohs}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhM0hj ubh)}(hUsing any of these outside of include/uapi/ is not preferred as using the function without __constant_ is identical when the argument is a constant.h]hUsing any of these outside of include/uapi/ is not preferred as using the function without __constant_ is identical when the argument is a constant.}(hj# hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hj ubh)}(hsIn big endian systems, the macros like __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to the same expression::h]hrIn big endian systems, the macros like __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to the same expression:}(hj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM;hj ubj)}(h}#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) #define __cpu_to_be32(x) ((__force __be32)(__u32)(x))h]h}#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) #define __cpu_to_be32(x) ((__force __be32)(__u32)(x))}hj? sbah}(h]h ]h"]h$]h&]hhuh1jhhhM>hj ubh)}(hIn little endian systems, the macros __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to __constant_swab32 and __swab32. __swab32 has a __builtin_constant_p check::h]hIn little endian systems, the macros __constant_cpu_to_be32(x) and cpu_to_be32(x) expand to __constant_swab32 and __swab32. __swab32 has a __builtin_constant_p check:}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhj ubj)}(h#define __swab32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___constant_swab32(x) : \ __fswab32(x))h]h#define __swab32(x) \ (__builtin_constant_p((__u32)(x)) ? \ ___constant_swab32(x) : \ __fswab32(x))}hj[ sbah}(h]h ]h"]h$]h&]hhuh1jhhhMEhj ubh)}(hSo ultimately they have a special case for constants. Similar is the case with all of the macros in the list. Thus using the __constant_... forms are unnecessarily verbose and not preferred outside of include/uapi.h]hSo ultimately they have a special case for constants. Similar is the case with all of the macros in the list. Thus using the __constant_... forms are unnecessarily verbose and not preferred outside of include/uapi.}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj ubh)}(hESee: https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/h](hSee: }(hjw hhhNhNubj)}(h@https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/h]h@https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhjw ubeh}(h]h ]h"]h$]h&]uh1hhhhMOhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMOhj ubjq)}(hX:**DEPRECATED_API** Usage of a deprecated RCU API is detected. It is recommended to replace old flavourful RCU APIs by their new vanilla-RCU counterparts. The full list of available RCU APIs can be viewed from the kernel docs. See: https://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apis h](jw)}(h**DEPRECATED_API**h]j})}(hj h]hDEPRECATED_API}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMWhj ubj)}(hhh](h)}(hUsage of a deprecated RCU API is detected. It is recommended to replace old flavourful RCU APIs by their new vanilla-RCU counterparts.h]hUsage of a deprecated RCU API is detected. It is recommended to replace old flavourful RCU APIs by their new vanilla-RCU counterparts.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhj ubh)}(hGThe full list of available RCU APIs can be viewed from the kernel docs.h]hGThe full list of available RCU APIs can be viewed from the kernel docs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj ubh)}(hTSee: https://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apish](hSee: }(hj hhhNhNubj)}(hOhttps://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apish]hOhttps://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apis}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMWhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMWhj ubjq)}(hX **DEVICE_ATTR_FUNCTIONS** The function names used in DEVICE_ATTR is unusual. Typically, the store and show functions are used with _store and _show, where is a named attribute variable of the device. Consider the following examples:: static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(power, 0644, power_show, power_store); The function names should preferably follow the above pattern. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes h](jw)}(h**DEVICE_ATTR_FUNCTIONS**h]j})}(hj h]hDEVICE_ATTR_FUNCTIONS}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMehj ubj)}(hhh](h)}(hThe function names used in DEVICE_ATTR is unusual. Typically, the store and show functions are used with _store and _show, where is a named attribute variable of the device.h]hThe function names used in DEVICE_ATTR is unusual. Typically, the store and show functions are used with _store and _show, where is a named attribute variable of the device.}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhj ubh)}(h!Consider the following examples::h]h Consider the following examples:}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj ubj)}(hjstatic DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(power, 0644, power_show, power_store);h]hjstatic DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(power, 0644, power_show, power_store);}hj= sbah}(h]h ]h"]h$]h&]hhuh1jhhhM`hj ubh)}(h>The function names should preferably follow the above pattern.h]h>The function names should preferably follow the above pattern.}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj ubh)}(hZSee: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh](hSee: }(hjY hhhNhNubj)}(hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh]hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes}(hja hhhNhNubah}(h]h ]h"]h$]h&]refurijc uh1jhjY ubeh}(h]h ]h"]h$]h&]uh1hhhhMehj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMehj ubjq)}(hXJ**DEVICE_ATTR_RO** The DEVICE_ATTR_RO(name) helper macro can be used instead of DEVICE_ATTR(name, 0444, name_show, NULL); Note that the macro automatically appends _show to the named attribute variable of the device for the show method. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes h](jw)}(h**DEVICE_ATTR_RO**h]j})}(hj h]hDEVICE_ATTR_RO}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMnhj ubj)}(hhh](h)}(hfThe DEVICE_ATTR_RO(name) helper macro can be used instead of DEVICE_ATTR(name, 0444, name_show, NULL);h]hfThe DEVICE_ATTR_RO(name) helper macro can be used instead of DEVICE_ATTR(name, 0444, name_show, NULL);}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhhj ubh)}(hrNote that the macro automatically appends _show to the named attribute variable of the device for the show method.h]hrNote that the macro automatically appends _show to the named attribute variable of the device for the show method.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhj ubh)}(hZSee: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh](hSee: }(hj hhhNhNubj)}(hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh]hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMnhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMnhj ubjq)}(hXf**DEVICE_ATTR_RW** The DEVICE_ATTR_RW(name) helper macro can be used instead of DEVICE_ATTR(name, 0644, name_show, name_store); Note that the macro automatically appends _show and _store to the named attribute variable of the device for the show and store methods. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes h](jw)}(h**DEVICE_ATTR_RW**h]j})}(hj h]hDEVICE_ATTR_RW}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMwhj ubj)}(hhh](h)}(hlThe DEVICE_ATTR_RW(name) helper macro can be used instead of DEVICE_ATTR(name, 0644, name_show, name_store);h]hlThe DEVICE_ATTR_RW(name) helper macro can be used instead of DEVICE_ATTR(name, 0644, name_show, name_store);}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMqhj ubh)}(hNote that the macro automatically appends _show and _store to the named attribute variable of the device for the show and store methods.h]hNote that the macro automatically appends _show and _store to the named attribute variable of the device for the show and store methods.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthj ubh)}(hZSee: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh](hSee: }(hj hhhNhNubj)}(hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh]hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes}(hj' hhhNhNubah}(h]h ]h"]h$]h&]refurij) uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMwhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMwhj ubjq)}(hXM**DEVICE_ATTR_WO** The DEVICE_AATR_WO(name) helper macro can be used instead of DEVICE_ATTR(name, 0200, NULL, name_store); Note that the macro automatically appends _store to the named attribute variable of the device for the store method. See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes h](jw)}(h**DEVICE_ATTR_WO**h]j})}(hjN h]hDEVICE_ATTR_WO}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjL ubah}(h]h ]h"]h$]h&]uh1jvhhhMhjH ubj)}(hhh](h)}(hgThe DEVICE_AATR_WO(name) helper macro can be used instead of DEVICE_ATTR(name, 0200, NULL, name_store);h]hgThe DEVICE_AATR_WO(name) helper macro can be used instead of DEVICE_ATTR(name, 0200, NULL, name_store);}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhjc ubh)}(htNote that the macro automatically appends _store to the named attribute variable of the device for the store method.h]htNote that the macro automatically appends _store to the named attribute variable of the device for the store method.}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hjc ubh)}(hZSee: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh](hSee: }(hj hhhNhNubj)}(hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributesh]hUhttps://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjc ubeh}(h]h ]h"]h$]h&]uh1jhjH ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hXH**DUPLICATED_SYSCTL_CONST** Commit d91bff3011cf ("proc/sysctl: add shared variables for range check") added some shared const variables to be used instead of a local copy in each source file. Consider replacing the sysctl range checking value with the shared one in include/linux/sysctl.h. The following conversion scheme may be used:: &zero -> SYSCTL_ZERO &one -> SYSCTL_ONE &int_max -> SYSCTL_INT_MAX See: 1. https://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/ 2. https://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/ h](jw)}(h**DUPLICATED_SYSCTL_CONST**h]j})}(hj h]hDUPLICATED_SYSCTL_CONST}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj ubah}(h]h ]h"]h$]h&]uh1jvhhhMhj ubj)}(hhh](h)}(hCommit d91bff3011cf ("proc/sysctl: add shared variables for range check") added some shared const variables to be used instead of a local copy in each source file.h]hCommit d91bff3011cf (“proc/sysctl: add shared variables for range check”) added some shared const variables to be used instead of a local copy in each source file.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(hConsider replacing the sysctl range checking value with the shared one in include/linux/sysctl.h. The following conversion scheme may be used::h]hConsider replacing the sysctl range checking value with the shared one in include/linux/sysctl.h. The following conversion scheme may be used:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(hO&zero -> SYSCTL_ZERO &one -> SYSCTL_ONE &int_max -> SYSCTL_INT_MAXh]hO&zero -> SYSCTL_ZERO &one -> SYSCTL_ONE &int_max -> SYSCTL_INT_MAX}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhj ubh)}(hSee:h]hSee:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj3)}(h1. https://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/ 2. https://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/ h]henumerated_list)}(hhh](j>)}(hFhttps://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/h]h)}(hj h]j)}(hj h]hFhttps://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j=hjubj>)}(hGhttps://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/ h]h)}(hFhttps://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/h]j)}(hj1h]hFhttps://lore.kernel.org/lkml/20190531131422.14970-1-mcroce@redhat.com/}(hj3hhhNhNubah}(h]h ]h"]h$]h&]refurij1uh1jhj/ubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1j=hjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjubah}(h]h ]h"]h$]h&]uh1j2hhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hX5**ENOSYS** ENOSYS means that a nonexistent system call was called. Earlier, it was wrongly used for things like invalid operations on otherwise valid syscalls. This should be avoided in new code. See: https://lore.kernel.org/lkml/5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net/ h](jw)}(h **ENOSYS**h]j})}(hjph]hENOSYS}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjnubah}(h]h ]h"]h$]h&]uh1jvhhhMhjjubj)}(hhh](h)}(hENOSYS means that a nonexistent system call was called. Earlier, it was wrongly used for things like invalid operations on otherwise valid syscalls. This should be avoided in new code.h]hENOSYS means that a nonexistent system call was called. Earlier, it was wrongly used for things like invalid operations on otherwise valid syscalls. This should be avoided in new code.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hnSee: https://lore.kernel.org/lkml/5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net/h](hSee: }(hjhhhNhNubj)}(hihttps://lore.kernel.org/lkml/5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net/h]hihttps://lore.kernel.org/lkml/5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**ENOTSUPP** ENOTSUPP is not a standard error code and should be avoided in new patches. EOPNOTSUPP should be used instead. See: https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/ h](jw)}(h **ENOTSUPP**h]j})}(hjh]hENOTSUPP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh](h)}(hnENOTSUPP is not a standard error code and should be avoided in new patches. EOPNOTSUPP should be used instead.h]hnENOTSUPP is not a standard error code and should be avoided in new patches. EOPNOTSUPP should be used instead.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hDSee: https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/h](hSee: }(hjhhhNhNubj)}(h?https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/h]h?https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hU**EXPORT_SYMBOL** EXPORT_SYMBOL should immediately follow the symbol to be exported. h](jw)}(h**EXPORT_SYMBOL**h]j})}(hjh]h EXPORT_SYMBOL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh]h)}(hBEXPORT_SYMBOL should immediately follow the symbol to be exported.h]hBEXPORT_SYMBOL should immediately follow the symbol to be exported.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hX|**IN_ATOMIC** in_atomic() is not for driver use so any such use is reported as an ERROR. Also in_atomic() is often used to determine if sleeping is permitted, but it is not reliable in this use model. Therefore its use is strongly discouraged. However, in_atomic() is ok for core kernel use. See: https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/ h](jw)}(h **IN_ATOMIC**h]j})}(hjRh]h IN_ATOMIC}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjPubah}(h]h ]h"]h$]h&]uh1jvhhhMhjLubj)}(hhh](h)}(hin_atomic() is not for driver use so any such use is reported as an ERROR. Also in_atomic() is often used to determine if sleeping is permitted, but it is not reliable in this use model. Therefore its use is strongly discouraged.h]hin_atomic() is not for driver use so any such use is reported as an ERROR. Also in_atomic() is often used to determine if sleeping is permitted, but it is not reliable in this use model. Therefore its use is strongly discouraged.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjgubh)}(h/However, in_atomic() is ok for core kernel use.h]h/However, in_atomic() is ok for core kernel use.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjgubh)}(hTSee: https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/h](hSee: }(hjhhhNhNubj)}(hOhttps://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/h]hOhttps://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjgubeh}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hX**LOCKDEP** The lockdep_no_validate class was added as a temporary measure to prevent warnings on conversion of device->sem to device->mutex. It should not be used for any other purpose. See: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/ h](jw)}(h **LOCKDEP**h]j})}(hjh]hLOCKDEP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh](h)}(hThe lockdep_no_validate class was added as a temporary measure to prevent warnings on conversion of device->sem to device->mutex. It should not be used for any other purpose.h]hThe lockdep_no_validate class was added as a temporary measure to prevent warnings on conversion of device->sem to device->mutex. It should not be used for any other purpose.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hCSee: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/h](hSee: }(hjhhhNhNubj)}(h>https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/h]h>https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**MALFORMED_INCLUDE** The #include statement has a malformed path. This has happened because the author has included a double slash "//" in the pathname accidentally. h](jw)}(h**MALFORMED_INCLUDE**h]j})}(hj h]hMALFORMED_INCLUDE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh]h)}(hThe #include statement has a malformed path. This has happened because the author has included a double slash "//" in the pathname accidentally.h]hThe #include statement has a malformed path. This has happened because the author has included a double slash “//” in the pathname accidentally.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**USE_LOCKDEP** lockdep_assert_held() annotations should be preferred over assertions based on spin_is_locked() See: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations h](jw)}(h**USE_LOCKDEP**h]j})}(hjBh]h USE_LOCKDEP}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj@ubah}(h]h ]h"]h$]h&]uh1jvhhhMhj<ubj)}(hhh](h)}(h_lockdep_assert_held() annotations should be preferred over assertions based on spin_is_locked()h]h_lockdep_assert_held() annotations should be preferred over assertions based on spin_is_locked()}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjWubh)}(hSSee: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotationsh](hSee: }(hjhhhhNhNubj)}(hNhttps://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotationsh]hNhttps://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations}(hjphhhNhNubah}(h]h ]h"]h$]h&]refurijruh1jhjhubeh}(h]h ]h"]h$]h&]uh1hhhhMhjWubeh}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(hQ**UAPI_INCLUDE** No #include statements in include/uapi should use a uapi/ path. h](jw)}(h**UAPI_INCLUDE**h]j})}(hjh]h UAPI_INCLUDE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh]h)}(h?No #include statements in include/uapi should use a uapi/ path.h]h?No #include statements in include/uapi should use a uapi/ path.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubjq)}(h**USLEEP_RANGE** usleep_range() should be preferred over udelay(). The proper way of using usleep_range() is mentioned in the kernel docs. h](jw)}(h**USLEEP_RANGE**h]j})}(hjh]h USLEEP_RANGE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh]h)}(hyusleep_range() should be preferred over udelay(). The proper way of using usleep_range() is mentioned in the kernel docs.h]hyusleep_range() should be preferred over udelay(). The proper way of using usleep_range() is mentioned in the kernel docs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj ubeh}(h]h ]h"]h$]h&]uh1jkhj ubah}(h]h ]h"]h$]h&]uh1j2hhhMhj hhubeh}(h] api-usageah ]h"] api usageah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hCommentsh]hComments}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubj3)}(hX**BLOCK_COMMENT_STYLE** The comment style is incorrect. The preferred style for multi- line comments is:: /* * This is the preferred style * for multi line comments. */ The networking comment style is a bit different, with the first line not empty like the former:: /* This is the preferred comment style * for files in net/ and drivers/net/ */ See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting **C99_COMMENTS** C99 style single line comments (//) should not be used. Prefer the block comment style instead. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting **DATA_RACE** Applications of data_race() should have a comment so as to document the reasoning behind why it was deemed safe. See: https://lore.kernel.org/lkml/20200401101714.44781-1-elver@google.com/ **FSF_MAILING_ADDRESS** Kernel maintainers reject new instances of the GPL boilerplate paragraph directing people to write to the FSF for a copy of the GPL, since the FSF has moved in the past and may do so again. So do not write paragraphs about writing to the Free Software Foundation's mailing address. See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/ h]jl)}(hhh](jq)}(hX**BLOCK_COMMENT_STYLE** The comment style is incorrect. The preferred style for multi- line comments is:: /* * This is the preferred style * for multi line comments. */ The networking comment style is a bit different, with the first line not empty like the former:: /* This is the preferred comment style * for files in net/ and drivers/net/ */ See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting h](jw)}(h**BLOCK_COMMENT_STYLE**h]j})}(hj3h]hBLOCK_COMMENT_STYLE}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hj1ubah}(h]h ]h"]h$]h&]uh1jvhhhMhj-ubj)}(hhh](h)}(hRThe comment style is incorrect. The preferred style for multi- line comments is::h]hQThe comment style is incorrect. The preferred style for multi- line comments is:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjHubj)}(h>/* * This is the preferred style * for multi line comments. */h]h>/* * This is the preferred style * for multi line comments. */}hjYsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjHubh)}(h`The networking comment style is a bit different, with the first line not empty like the former::h]h_The networking comment style is a bit different, with the first line not empty like the former:}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjHubj)}(hN/* This is the preferred comment style * for files in net/ and drivers/net/ */h]hN/* This is the preferred comment style * for files in net/ and drivers/net/ */}hjusbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjHubh)}(hPSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#commentingh](hSee: }(hjhhhNhNubj)}(hKhttps://www.kernel.org/doc/html/latest/process/coding-style.html#commentingh]hKhttps://www.kernel.org/doc/html/latest/process/coding-style.html#commenting}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjHubeh}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jphhhMhj*ubjq)}(h**C99_COMMENTS** C99 style single line comments (//) should not be used. Prefer the block comment style instead. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting h](jw)}(h**C99_COMMENTS**h]j})}(hjh]h C99_COMMENTS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh](h)}(h_C99 style single line comments (//) should not be used. Prefer the block comment style instead.h]h_C99 style single line comments (//) should not be used. Prefer the block comment style instead.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hPSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#commentingh](hSee: }(hjhhhNhNubj)}(hKhttps://www.kernel.org/doc/html/latest/process/coding-style.html#commentingh]hKhttps://www.kernel.org/doc/html/latest/process/coding-style.html#commenting}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj*ubjq)}(h**DATA_RACE** Applications of data_race() should have a comment so as to document the reasoning behind why it was deemed safe. See: https://lore.kernel.org/lkml/20200401101714.44781-1-elver@google.com/ h](jw)}(h **DATA_RACE**h]j})}(hjh]h DATA_RACE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjubah}(h]h ]h"]h$]h&]uh1jvhhhMhjubj)}(hhh](h)}(hpApplications of data_race() should have a comment so as to document the reasoning behind why it was deemed safe.h]hpApplications of data_race() should have a comment so as to document the reasoning behind why it was deemed safe.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hJSee: https://lore.kernel.org/lkml/20200401101714.44781-1-elver@google.com/h](hSee: }(hj-hhhNhNubj)}(hEhttps://lore.kernel.org/lkml/20200401101714.44781-1-elver@google.com/h]hEhttps://lore.kernel.org/lkml/20200401101714.44781-1-elver@google.com/}(hj5hhhNhNubah}(h]h ]h"]h$]h&]refurij7uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jphhhMhj*ubjq)}(hXs**FSF_MAILING_ADDRESS** Kernel maintainers reject new instances of the GPL boilerplate paragraph directing people to write to the FSF for a copy of the GPL, since the FSF has moved in the past and may do so again. So do not write paragraphs about writing to the Free Software Foundation's mailing address. See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/ h](jw)}(h**FSF_MAILING_ADDRESS**h]j})}(hj\h]hFSF_MAILING_ADDRESS}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j|hjZubah}(h]h ]h"]h$]h&]uh1jvhhhMhjVubj)}(hhh](h)}(hXKernel maintainers reject new instances of the GPL boilerplate paragraph directing people to write to the FSF for a copy of the GPL, since the FSF has moved in the past and may do so again. So do not write paragraphs about writing to the Free Software Foundation's mailing address.h]hXKernel maintainers reject new instances of the GPL boilerplate paragraph directing people to write to the FSF for a copy of the GPL, since the FSF has moved in the past and may do so again. So do not write paragraphs about writing to the Free Software Foundation’s mailing address.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjqubh)}(h>See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/h](hSee: }(hjhhhNhNubj)}(h9https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/h]h9https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjqubeh}(h]h ]h"]h$]h&]uh1jhjVubeh}(h]h ]h"]h$]h&]uh1jphhhMhj*ubeh}(h]h ]h"]h$]h&]uh1jkhj&ubah}(h]h ]h"]h$]h&]uh1j2hhhMhjhhubeh}(h]commentsah ]h"]commentsah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hCommit messageh]hCommit message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubj3)}(hX**BAD_SIGN_OFF** The signed-off-by line does not fall in line with the standards specified by the community. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1 **BAD_STABLE_ADDRESS_STYLE** The email format for stable is incorrect. Some valid options for stable address are:: 1. stable@vger.kernel.org 2. stable@kernel.org For adding version info, the following comment style should be used:: stable@vger.kernel.org # version info **COMMIT_COMMENT_SYMBOL** Commit log lines starting with a '#' are ignored by git as comments. To solve this problem addition of a single space infront of the log line is enough. **COMMIT_MESSAGE** The patch is missing a commit description. A brief description of the changes made by the patch should be added. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes **EMAIL_SUBJECT** Naming the tool that found the issue is not very useful in the subject line. A good subject line summarizes the change that the patch brings. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes **FROM_SIGN_OFF_MISMATCH** The author's email does not match with that in the Signed-off-by: line(s). This can be sometimes caused due to an improperly configured email client. This message is emitted due to any of the following reasons:: - The email names do not match. - The email addresses do not match. - The email subaddresses do not match. - The email comments do not match. **MISSING_SIGN_OFF** The patch is missing a Signed-off-by line. A signed-off-by line should be added according to Developer's certificate of Origin. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin **NO_AUTHOR_SIGN_OFF** The author of the patch has not signed off the patch. It is required that a simple sign off line should be present at the end of explanation of the patch to denote that the author has written it or otherwise has the rights to pass it on as an open source patch. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin **DIFF_IN_COMMIT_MSG** Avoid having diff content in commit message. This causes problems when one tries to apply a file containing both the changelog and the diff because patch(1) tries to apply the diff which it found in the changelog. See: https://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/ **GERRIT_CHANGE_ID** To be picked up by gerrit, the footer of the commit message might have a Change-Id like:: Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b Signed-off-by: A. U. Thor The Change-Id line must be removed before submitting. **GIT_COMMIT_ID** The proper way to reference a commit id is: commit <12+ chars of sha1> ("") An example may be:: Commit e21d2170f36602ae2708 ("video: remove unnecessary platform_set_drvdata()") removed the unnecessary platform_set_drvdata(), but left the variable "dev" unused, delete it. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes **BAD_FIXES_TAG** The Fixes: tag is malformed or does not follow the community conventions. This can occur if the tag have been split into multiple lines (e.g., when pasted in an email program with word wrapping enabled). See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes h]jl��)}(hhh](jq��)}(h**BAD_SIGN_OFF** The signed-off-by line does not fall in line with the standards specified by the community. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1 h](jw��)}(h**BAD_SIGN_OFF**h]j}��)}(hj��h]h BAD_SIGN_OFF}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(h[The signed-off-by line does not fall in line with the standards specified by the community.h]h[The signed-off-by line does not fall in line with the standards specified by the community.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hqSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1h](hSee: }(hj��hhhNhNubj��)}(hlhttps://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1h]hlhttps://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]refurij ��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**BAD_STABLE_ADDRESS_STYLE** The email format for stable is incorrect. Some valid options for stable address are:: 1. stable@vger.kernel.org 2. stable@kernel.org For adding version info, the following comment style should be used:: stable@vger.kernel.org # version info h](jw��)}(h**BAD_STABLE_ADDRESS_STYLE**h]j}��)}(hj2��h]hBAD_STABLE_ADDRESS_STYLE}(hj4��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj0��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj,��ubj��)}(hhh](h)}(hUThe email format for stable is incorrect. Some valid options for stable address are::h]hTThe email format for stable is incorrect. Some valid options for stable address are:}(hjJ��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjG��ubj��)}(h.1. stable@vger.kernel.org 2. stable@kernel.orgh]h.1. stable@vger.kernel.org 2. stable@kernel.org}hjX��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM�hjG��ubh)}(hEFor adding version info, the following comment style should be used::h]hDFor adding version info, the following comment style should be used:}(hjf��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjG��ubj��)}(h%stable@vger.kernel.org # version infoh]h%stable@vger.kernel.org # version info}hjt��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhjG��ubeh}(h]h ]h"]h$]h&]uh1j��hj,��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(h**COMMIT_COMMENT_SYMBOL** Commit log lines starting with a '#' are ignored by git as comments. To solve this problem addition of a single space infront of the log line is enough. h](jw��)}(h**COMMIT_COMMENT_SYMBOL**h]j}��)}(hj��h]hCOMMIT_COMMENT_SYMBOL}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM hj��ubj��)}(hhh]h)}(hCommit log lines starting with a '#' are ignored by git as comments. To solve this problem addition of a single space infront of the log line is enough.h]hCommit log lines starting with a ‘#’ are ignored by git as comments. To solve this problem addition of a single space infront of the log line is enough.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubah}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM hj��ubjq��)}(h**COMMIT_MESSAGE** The patch is missing a commit description. A brief description of the changes made by the patch should be added. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes h](jw��)}(h**COMMIT_MESSAGE**h]j}��)}(hj��h]hCOMMIT_MESSAGE}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hqThe patch is missing a commit description. A brief description of the changes made by the patch should be added.h]hqThe patch is missing a commit description. A brief description of the changes made by the patch should be added.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj��ubh)}(haSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh](hSee: }(hj��hhhNhNubj��)}(h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh]h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**EMAIL_SUBJECT** Naming the tool that found the issue is not very useful in the subject line. A good subject line summarizes the change that the patch brings. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes h](jw��)}(h**EMAIL_SUBJECT**h]j}��)}(hj!��h]h EMAIL_SUBJECT}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hNaming the tool that found the issue is not very useful in the subject line. A good subject line summarizes the change that the patch brings.h]hNaming the tool that found the issue is not very useful in the subject line. A good subject line summarizes the change that the patch brings.}(hj9��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6��ubh)}(haSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh](hSee: }(hjG��hhhNhNubj��)}(h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh]h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes}(hjO��hhhNhNubah}(h]h ]h"]h$]h&]refurijQ��uh1j��hjG��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj6��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**FROM_SIGN_OFF_MISMATCH** The author's email does not match with that in the Signed-off-by: line(s). This can be sometimes caused due to an improperly configured email client. This message is emitted due to any of the following reasons:: - The email names do not match. - The email addresses do not match. - The email subaddresses do not match. - The email comments do not match. h](jw��)}(h**FROM_SIGN_OFF_MISMATCH**h]j}��)}(hjv��h]hFROM_SIGN_OFF_MISMATCH}(hjx��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjt��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM#hjp��ubj��)}(hhh](h)}(hThe author's email does not match with that in the Signed-off-by: line(s). This can be sometimes caused due to an improperly configured email client.h]hThe author’s email does not match with that in the Signed-off-by: line(s). This can be sometimes caused due to an improperly configured email client.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(h=This message is emitted due to any of the following reasons::h]h<This message is emitted due to any of the following reasons:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(h- The email names do not match. - The email addresses do not match. - The email subaddresses do not match. - The email comments do not match.h]h- The email names do not match. - The email addresses do not match. - The email subaddresses do not match. - The email comments do not match.}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM hj��ubeh}(h]h ]h"]h$]h&]uh1j��hjp��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM#hj��ubjq��)}(hX��**MISSING_SIGN_OFF** The patch is missing a Signed-off-by line. A signed-off-by line should be added according to Developer's certificate of Origin. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin h](jw��)}(h**MISSING_SIGN_OFF**h]j}��)}(hj��h]hMISSING_SIGN_OFF}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM*hj��ubj��)}(hhh](h)}(hThe patch is missing a Signed-off-by line. A signed-off-by line should be added according to Developer's certificate of Origin.h]hThe patch is missing a Signed-off-by line. A signed-off-by line should be added according to Developer’s certificate of Origin.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hj��ubh)}(hSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-originh](hSee: }(hj��hhhNhNubj��)}(h{https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-originh]h{https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhM*hj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM*hj��ubjq��)}(hX��**NO_AUTHOR_SIGN_OFF** The author of the patch has not signed off the patch. It is required that a simple sign off line should be present at the end of explanation of the patch to denote that the author has written it or otherwise has the rights to pass it on as an open source patch. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin h](jw��)}(h**NO_AUTHOR_SIGN_OFF**h]j}��)}(hj��h]hNO_AUTHOR_SIGN_OFF}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM3hj��ubj��)}(hhh](h)}(hX��The author of the patch has not signed off the patch. It is required that a simple sign off line should be present at the end of explanation of the patch to denote that the author has written it or otherwise has the rights to pass it on as an open source patch.h]hX��The author of the patch has not signed off the patch. It is required that a simple sign off line should be present at the end of explanation of the patch to denote that the author has written it or otherwise has the rights to pass it on as an open source patch.}(hj7��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hj4��ubh)}(hSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-originh](hSee: }(hjE��hhhNhNubj��)}(h{https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-originh]h{https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin}(hjM��hhhNhNubah}(h]h ]h"]h$]h&]refurijO��uh1j��hjE��ubeh}(h]h ]h"]h$]h&]uh1hhhhM3hj4��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM3hj��ubjq��)}(hXN��**DIFF_IN_COMMIT_MSG** Avoid having diff content in commit message. This causes problems when one tries to apply a file containing both the changelog and the diff because patch(1) tries to apply the diff which it found in the changelog. See: https://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/ h](jw��)}(h**DIFF_IN_COMMIT_MSG**h]j}��)}(hjt��h]hDIFF_IN_COMMIT_MSG}(hjv��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjr��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM;hjn��ubj��)}(hhh](h)}(hAvoid having diff content in commit message. This causes problems when one tries to apply a file containing both the changelog and the diff because patch(1) tries to apply the diff which it found in the changelog.h]hAvoid having diff content in commit message. This causes problems when one tries to apply a file containing both the changelog and the diff because patch(1) tries to apply the diff which it found in the changelog.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj��ubh)}(h_See: https://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/h](hSee: }(hj��hhhNhNubj��)}(hZhttps://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/h]hZhttps://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhM;hj��ubeh}(h]h ]h"]h$]h&]uh1j��hjn��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM;hj��ubjq��)}(hX��**GERRIT_CHANGE_ID** To be picked up by gerrit, the footer of the commit message might have a Change-Id like:: Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b Signed-off-by: A. U. Thor <author@example.com> The Change-Id line must be removed before submitting. h](jw��)}(h**GERRIT_CHANGE_ID**h]j}��)}(hj��h]hGERRIT_CHANGE_ID}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMDhj��ubj��)}(hhh](h)}(hYTo be picked up by gerrit, the footer of the commit message might have a Change-Id like::h]hXTo be picked up by gerrit, the footer of the commit message might have a Change-Id like:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hj��ubj��)}(hcChange-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b Signed-off-by: A. U. Thor <author@example.com>h]hcChange-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b Signed-off-by: A. U. Thor <author@example.com>}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMAhj��ubh)}(h5The Change-Id line must be removed before submitting.h]h5The Change-Id line must be removed before submitting.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMDhj��ubjq��)}(hX��**GIT_COMMIT_ID** The proper way to reference a commit id is: commit <12+ chars of sha1> ("<title line>") An example may be:: Commit e21d2170f36602ae2708 ("video: remove unnecessary platform_set_drvdata()") removed the unnecessary platform_set_drvdata(), but left the variable "dev" unused, delete it. See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes h](jw��)}(h**GIT_COMMIT_ID**h]j}��)}(hj��h]h GIT_COMMIT_ID}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMQhj��ubj��)}(hhh](h)}(hWThe proper way to reference a commit id is: commit <12+ chars of sha1> ("<title line>")h]h[The proper way to reference a commit id is: commit <12+ chars of sha1> (“<title line>”)}(hj5��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhj2��ubh)}(hAn example may be::h]hAn example may be:}(hjC��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj2��ubj��)}(hCommit e21d2170f36602ae2708 ("video: remove unnecessary platform_set_drvdata()") removed the unnecessary platform_set_drvdata(), but left the variable "dev" unused, delete it.h]hCommit e21d2170f36602ae2708 ("video: remove unnecessary platform_set_drvdata()") removed the unnecessary platform_set_drvdata(), but left the variable "dev" unused, delete it.}hjQ��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMLhj2��ubh)}(haSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh](hSee: }(hj_��hhhNhNubj��)}(h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh]h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes}(hjg��hhhNhNubah}(h]h ]h"]h$]h&]refuriji��uh1j��hj_��ubeh}(h]h ]h"]h$]h&]uh1hhhhMQhj2��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMQhj��ubjq��)}(hXB��**BAD_FIXES_TAG** The Fixes: tag is malformed or does not follow the community conventions. This can occur if the tag have been split into multiple lines (e.g., when pasted in an email program with word wrapping enabled). See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes h](jw��)}(h**BAD_FIXES_TAG**h]j}��)}(hj��h]h BAD_FIXES_TAG}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMYhj��ubj��)}(hhh](h)}(hThe Fixes: tag is malformed or does not follow the community conventions. This can occur if the tag have been split into multiple lines (e.g., when pasted in an email program with word wrapping enabled).h]hThe Fixes: tag is malformed or does not follow the community conventions. This can occur if the tag have been split into multiple lines (e.g., when pasted in an email program with word wrapping enabled).}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThj��ubh)}(haSee: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh](hSee: }(hj��hhhNhNubj��)}(h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changesh]h\https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMXhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMYhj��ubeh}(h]h ]h"]h$]h&]uh1jk��hj��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj��hhubeh}(h]commit-messageah ]h"]commit messageah$]h&]uh1hhj��hhhhhMubh)}(hhh](h)}(hComparison styleh]hComparison style}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj��hhhhhM\ubj3��)}(hXZ��**ASSIGN_IN_IF** Do not use assignments in if condition. Example:: if ((foo = bar(...)) < BAZ) { should be written as:: foo = bar(...); if (foo < BAZ) { **BOOL_COMPARISON** Comparisons of A to true and false are better written as A and !A. See: https://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/ **COMPARISON_TO_NULL** Comparisons to NULL in the form (foo == NULL) or (foo != NULL) are better written as (!foo) and (foo). **CONSTANT_COMPARISON** Comparisons with a constant or upper case identifier on the left side of the test should be avoided. h]jl��)}(hhh](jq��)}(h**ASSIGN_IN_IF** Do not use assignments in if condition. Example:: if ((foo = bar(...)) < BAZ) { should be written as:: foo = bar(...); if (foo < BAZ) { h](jw��)}(h**ASSIGN_IN_IF**h]j}��)}(hj��h]h ASSIGN_IN_IF}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj ��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMghj ��ubj��)}(hhh](h)}(h1Do not use assignments in if condition. Example::h]h0Do not use assignments in if condition. Example:}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hj$��ubj��)}(hif ((foo = bar(...)) < BAZ) {h]hif ((foo = bar(...)) < BAZ) {}hj5��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMbhj$��ubh)}(hshould be written as::h]hshould be written as:}(hjC��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhj$��ubj��)}(h foo = bar(...); if (foo < BAZ) {h]h foo = bar(...); if (foo < BAZ) {}hjQ��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMfhj$��ubeh}(h]h ]h"]h$]h&]uh1j��hj ��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMghj��ubjq��)}(h**BOOL_COMPARISON** Comparisons of A to true and false are better written as A and !A. See: https://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/ h](jw��)}(h**BOOL_COMPARISON**h]j}��)}(hjq��h]hBOOL_COMPARISON}(hjs��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjo��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMmhjk��ubj��)}(hhh](h)}(hBComparisons of A to true and false are better written as A and !A.h]hBComparisons of A to true and false are better written as A and !A.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhj��ubh)}(hFSee: https://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/h](hSee: }(hj��hhhNhNubj��)}(hAhttps://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/h]hAhttps://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMmhj��ubeh}(h]h ]h"]h$]h&]uh1j��hjk��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMmhj��ubjq��)}(h~**COMPARISON_TO_NULL** Comparisons to NULL in the form (foo == NULL) or (foo != NULL) are better written as (!foo) and (foo). h](jw��)}(h**COMPARISON_TO_NULL**h]j}��)}(hj��h]hCOMPARISON_TO_NULL}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMqhj��ubj��)}(hhh]h)}(hfComparisons to NULL in the form (foo == NULL) or (foo != NULL) are better written as (!foo) and (foo).h]hfComparisons to NULL in the form (foo == NULL) or (foo != NULL) are better written as (!foo) and (foo).}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphj��ubah}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMqhj��ubjq��)}(h~**CONSTANT_COMPARISON** Comparisons with a constant or upper case identifier on the left side of the test should be avoided. h](jw��)}(h**CONSTANT_COMPARISON**h]j}��)}(hj��h]hCONSTANT_COMPARISON}(hj���hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMvhj��ubj��)}(hhh]h)}(hdComparisons with a constant or upper case identifier on the left side of the test should be avoided.h]hdComparisons with a constant or upper case identifier on the left side of the test should be avoided.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthj��ubah}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMvhj��ubeh}(h]h ]h"]h$]h&]uh1jk��hj��ubah}(h]h ]h"]h$]h&]uh1j2��hhhM^hj��hhubeh}(h]comparison-styleah ]h"]comparison styleah$]h&]uh1hhj��hhhhhM\ubh)}(hhh](h)}(hIndentation and Line Breaksh]hIndentation and Line Breaks}(hjG��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjD��hhhhhMyubj3��)}(hX@��**CODE_INDENT** Code indent should use tabs instead of spaces. Outside of comments, documentation and Kconfig, spaces are never used for indentation. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation **DEEP_INDENTATION** Indentation with 6 or more tabs usually indicate overly indented code. It is suggested to refactor excessive indentation of if/else/for/do/while/switch statements. See: https://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/ **SWITCH_CASE_INDENT_LEVEL** switch should be at the same indent as case. Example:: switch (suffix) { case 'G': case 'g': mem <<= 30; break; case 'M': case 'm': mem <<= 20; break; case 'K': case 'k': mem <<= 10; fallthrough; default: break; } See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation **LONG_LINE** The line has exceeded the specified maximum length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. Earlier, the default line length was 80 columns. Commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning") increased the limit to 100 columns. This is not a hard limit either and it's preferable to stay within 80 columns whenever possible. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings **LONG_LINE_STRING** A string starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings **LONG_LINE_COMMENT** A comment starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings **SPLIT_STRING** Quoted strings that appear as messages in userspace and can be grepped, should not be split across multiple lines. See: https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/ **MULTILINE_DEREFERENCE** A single dereferencing identifier spanned on multiple lines like:: struct_identifier->member[index]. member = <foo>; is generally hard to follow. It can easily lead to typos and so makes the code vulnerable to bugs. If fixing the multiple line dereferencing leads to an 80 column violation, then either rewrite the code in a more simple way or if the starting part of the dereferencing identifier is the same and used at multiple places then store it in a temporary variable, and use that temporary variable only at all the places. For example, if there are two dereferencing identifiers:: member1->member2->member3.foo1; member1->member2->member3.foo2; then store the member1->member2->member3 part in a temporary variable. It not only helps to avoid the 80 column violation but also reduces the program size by removing the unnecessary dereferences. But if none of the above methods work then ignore the 80 column violation because it is much easier to read a dereferencing identifier on a single line. **TRAILING_STATEMENTS** Trailing statements (for example after any conditional) should be on the next line. Statements, such as:: if (x == y) break; should be:: if (x == y) break; h]jl��)}(hhh](jq��)}(h**CODE_INDENT** Code indent should use tabs instead of spaces. Outside of comments, documentation and Kconfig, spaces are never used for indentation. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation h](jw��)}(h**CODE_INDENT**h]j}��)}(hjb��h]h CODE_INDENT}(hjd��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj`��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj\��ubj��)}(hhh](h)}(hCode indent should use tabs instead of spaces. Outside of comments, documentation and Kconfig, spaces are never used for indentation.h]hCode indent should use tabs instead of spaces. Outside of comments, documentation and Kconfig, spaces are never used for indentation.}(hjz��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hjw��ubh)}(hQSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentationh](hSee: }(hj��hhhNhNubj��)}(hLhttps://www.kernel.org/doc/html/latest/process/coding-style.html#indentationh]hLhttps://www.kernel.org/doc/html/latest/process/coding-style.html#indentation}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjw��ubeh}(h]h ]h"]h$]h&]uh1j��hj\��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX��**DEEP_INDENTATION** Indentation with 6 or more tabs usually indicate overly indented code. It is suggested to refactor excessive indentation of if/else/for/do/while/switch statements. See: https://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/ h](jw��)}(h**DEEP_INDENTATION**h]j}��)}(hj��h]hDEEP_INDENTATION}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hFIndentation with 6 or more tabs usually indicate overly indented code.h]hFIndentation with 6 or more tabs usually indicate overly indented code.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(h\It is suggested to refactor excessive indentation of if/else/for/do/while/switch statements.h]h\It is suggested to refactor excessive indentation of if/else/for/do/while/switch statements.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hGSee: https://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/h](hSee: }(hj��hhhNhNubj��)}(hBhttps://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/h]hBhttps://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX��**SWITCH_CASE_INDENT_LEVEL** switch should be at the same indent as case. Example:: switch (suffix) { case 'G': case 'g': mem <<= 30; break; case 'M': case 'm': mem <<= 20; break; case 'K': case 'k': mem <<= 10; fallthrough; default: break; } See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation h](jw��)}(h**SWITCH_CASE_INDENT_LEVEL**h]j}��)}(hj��h]hSWITCH_CASE_INDENT_LEVEL}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(h6switch should be at the same indent as case. Example::h]h5switch should be at the same indent as case. Example:}(hj2��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/��ubj��)}(hswitch (suffix) { case 'G': case 'g': mem <<= 30; break; case 'M': case 'm': mem <<= 20; break; case 'K': case 'k': mem <<= 10; fallthrough; default: break; }h]hswitch (suffix) { case 'G': case 'g': mem <<= 30; break; case 'M': case 'm': mem <<= 20; break; case 'K': case 'k': mem <<= 10; fallthrough; default: break; }}hj@��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj/��ubh)}(hQSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentationh](hSee: }(hjN��hhhNhNubj��)}(hLhttps://www.kernel.org/doc/html/latest/process/coding-style.html#indentationh]hLhttps://www.kernel.org/doc/html/latest/process/coding-style.html#indentation}(hjV��hhhNhNubah}(h]h ]h"]h$]h&]refurijX��uh1j��hjN��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj/��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX��**LONG_LINE** The line has exceeded the specified maximum length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. Earlier, the default line length was 80 columns. Commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning") increased the limit to 100 columns. This is not a hard limit either and it's preferable to stay within 80 columns whenever possible. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings h](jw��)}(h **LONG_LINE**h]j}��)}(hj}��h]h LONG_LINE}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj{��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjw��ubj��)}(hhh](h)}(hThe line has exceeded the specified maximum length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.h]hThe line has exceeded the specified maximum length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hX��Earlier, the default line length was 80 columns. Commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning") increased the limit to 100 columns. This is not a hard limit either and it's preferable to stay within 80 columns whenever possible.h]hX ��Earlier, the default line length was 80 columns. Commit bdc48fa11e46 (“checkpatch/coding-style: deprecate 80-column warning”) increased the limit to 100 columns. This is not a hard limit either and it’s preferable to stay within 80 columns whenever possible.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(heSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh](hSee: }(hj��hhhNhNubj��)}(h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh]h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hjw��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX.��**LONG_LINE_STRING** A string starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings h](jw��)}(h**LONG_LINE_STRING**h]j}��)}(hj��h]hLONG_LINE_STRING}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hA string starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.h]hA string starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(heSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh](hSee: }(hj��hhhNhNubj��)}(h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh]h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX0��**LONG_LINE_COMMENT** A comment starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings h](jw��)}(h**LONG_LINE_COMMENT**h]j}��)}(hj5��h]hLONG_LINE_COMMENT}(hj7��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj3��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj/��ubj��)}(hhh](h)}(hA comment starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.h]hA comment starts before but extends beyond the maximum line length. To use a different maximum line length, the --max-line-length=n option may be added while invoking checkpatch.������}(hjM��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjJ��ubh)}(heSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh](hSee: }(hj[��hhhNhNubj��)}(h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-stringsh]h`https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings}(hjc��hhhNhNubah}(h]h ]h"]h$]h&]refurije��uh1j��hj[��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjJ��ubeh}(h]h ]h"]h$]h&]uh1j��hj/��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(h**SPLIT_STRING** Quoted strings that appear as messages in userspace and can be grepped, should not be split across multiple lines. See: https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/ h](jw��)}(h**SPLIT_STRING**h]j}��)}(hj��h]h SPLIT_STRING}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hrQuoted strings that appear as messages in userspace and can be grepped, should not be split across multiple lines.h]hrQuoted strings that appear as messages in userspace and can be grepped, should not be split across multiple lines.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(h>See: https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/h](hSee: }(hj��hhhNhNubj��)}(h9https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/h]h9https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(hX��**MULTILINE_DEREFERENCE** A single dereferencing identifier spanned on multiple lines like:: struct_identifier->member[index]. member = <foo>; is generally hard to follow. It can easily lead to typos and so makes the code vulnerable to bugs. If fixing the multiple line dereferencing leads to an 80 column violation, then either rewrite the code in a more simple way or if the starting part of the dereferencing identifier is the same and used at multiple places then store it in a temporary variable, and use that temporary variable only at all the places. For example, if there are two dereferencing identifiers:: member1->member2->member3.foo1; member1->member2->member3.foo2; then store the member1->member2->member3 part in a temporary variable. It not only helps to avoid the 80 column violation but also reduces the program size by removing the unnecessary dereferences. But if none of the above methods work then ignore the 80 column violation because it is much easier to read a dereferencing identifier on a single line. h](jw��)}(h**MULTILINE_DEREFERENCE**h]j}��)}(hj��h]hMULTILINE_DEREFERENCE}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hBA single dereferencing identifier spanned on multiple lines like::h]hAA single dereferencing identifier spanned on multiple lines like:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(h1struct_identifier->member[index]. member = <foo>;h]h1struct_identifier->member[index]. member = <foo>;}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj��ubh)}(hbis generally hard to follow. It can easily lead to typos and so makes the code vulnerable to bugs.h]hbis generally hard to follow. It can easily lead to typos and so makes the code vulnerable to bugs.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hXu��If fixing the multiple line dereferencing leads to an 80 column violation, then either rewrite the code in a more simple way or if the starting part of the dereferencing identifier is the same and used at multiple places then store it in a temporary variable, and use that temporary variable only at all the places. For example, if there are two dereferencing identifiers::h]hXt��If fixing the multiple line dereferencing leads to an 80 column violation, then either rewrite the code in a more simple way or if the starting part of the dereferencing identifier is the same and used at multiple places then store it in a temporary variable, and use that temporary variable only at all the places. For example, if there are two dereferencing identifiers:}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(h?member1->member2->member3.foo1; member1->member2->member3.foo2;h]h?member1->member2->member3.foo1; member1->member2->member3.foo2;}hj/��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj��ubh)}(hthen store the member1->member2->member3 part in a temporary variable. It not only helps to avoid the 80 column violation but also reduces the program size by removing the unnecessary dereferences.h]hthen store the member1->member2->member3 part in a temporary variable. It not only helps to avoid the 80 column violation but also reduces the program size by removing the unnecessary dereferences.}(hj=��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hBut if none of the above methods work then ignore the 80 column violation because it is much easier to read a dereferencing identifier on a single line.h]hBut if none of the above methods work then ignore the 80 column violation because it is much easier to read a dereferencing identifier on a single line.}(hjK��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubjq��)}(h**TRAILING_STATEMENTS** Trailing statements (for example after any conditional) should be on the next line. Statements, such as:: if (x == y) break; should be:: if (x == y) break; h](jw��)}(h**TRAILING_STATEMENTS**h]j}��)}(hjk��h]hTRAILING_STATEMENTS}(hjm��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hji��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhje��ubj��)}(hhh](h)}(hiTrailing statements (for example after any conditional) should be on the next line. Statements, such as::h]hhTrailing statements (for example after any conditional) should be on the next line. Statements, such as:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(hif (x == y) break;h]hif (x == y) break;}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj��ubh)}(h should be::h]h should be:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(hif (x == y) break;h]hif (x == y) break;}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hje��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhjY��ubeh}(h]h ]h"]h$]h&]uh1jk��hjU��ubah}(h]h ]h"]h$]h&]uh1j2��hhhM{hjD��hhubeh}(h]indentation-and-line-breaksah ]h"]indentation and line breaksah$]h&]uh1hhj��hhhhhMyubh)}(hhh](h)}(hMacros, Attributes and Symbolsh]hMacros, Attributes and Symbols}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj��hhhhhMubj3��)}(hX��**ARRAY_SIZE** The ARRAY_SIZE(foo) macro should be preferred over sizeof(foo)/sizeof(foo[0]) for finding number of elements in an array. The macro is defined in include/linux/kernel.h:: #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) **AVOID_EXTERNS** Function prototypes don't need to be declared extern in .h files. It's assumed by the compiler and is unnecessary. **AVOID_L_PREFIX** Local symbol names that are prefixed with `.L` should be avoided, as this has special meaning for the assembler; a symbol entry will not be emitted into the symbol table. This can prevent `objtool` from generating correct unwind info. Symbols with STB_LOCAL binding may still be used, and `.L` prefixed local symbol names are still generally usable within a function, but `.L` prefixed local symbol names should not be used to denote the beginning or end of code regions via `SYM_CODE_START_LOCAL`/`SYM_CODE_END` **BIT_MACRO** Defines like: 1 << <digit> could be BIT(digit). The BIT() macro is defined via include/linux/bits.h:: #define BIT(nr) (1UL << (nr)) **CONST_READ_MOSTLY** When a variable is tagged with the __read_mostly annotation, it is a signal to the compiler that accesses to the variable will be mostly reads and rarely(but NOT never) a write. const __read_mostly does not make any sense as const data is already read-only. The __read_mostly annotation thus should be removed. **DATE_TIME** It is generally desirable that building the same source code with the same set of tools is reproducible, i.e. the output is always exactly the same. The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, and enables warnings if they are used as they can lead to non-deterministic builds. See: https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestamps **DEFINE_ARCH_HAS** The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong. For big conceptual features use Kconfig symbols instead. And for smaller things where we have compatibility fallback functions but want architectures able to override them with optimized ones, we should either use weak functions (appropriate for some cases), or the symbol that protects them should be the same symbol we use. See: https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/ **DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON** do {} while(0) macros should not have a trailing semicolon. **INIT_ATTRIBUTE** Const init definitions should use __initconst instead of __initdata. Similarly init definitions without const require a separate use of const. **INLINE_LOCATION** The inline keyword should sit between storage class and type. For example, the following segment:: inline static int example_function(void) { ... } should be:: static inline int example_function(void) { ... } **MISPLACED_INIT** It is possible to use section markers on variables in a way which gcc doesn't understand (or at least not the way the developer intended):: static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = { does not put exynos4_plls in the .initdata section. The __initdata marker can be virtually anywhere on the line, except right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise. See: https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/ **MULTISTATEMENT_MACRO_USE_DO_WHILE** Macros with multiple statements should be enclosed in a do - while block. Same should also be the case for macros starting with `if` to avoid logic defects:: #define macrofun(a, b, c) \ do { \ if (a == 5) \ do_this(b, c); \ } while (0) See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl **PREFER_FALLTHROUGH** Use the `fallthrough;` pseudo keyword instead of `/* fallthrough */` like comments. **TRAILING_SEMICOLON** Macro definition should not end with a semicolon. The macro invocation style should be consistent with function calls. This can prevent any unexpected code paths:: #define MAC do_something; If this macro is used within a if else statement, like:: if (some_condition) MAC; else do_something; Then there would be a compilation error, because when the macro is expanded there are two trailing semicolons, so the else branch gets orphaned. See: https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/ **MACRO_ARG_UNUSED** If function-like macros do not utilize a parameter, it might result in a build warning. We advocate for utilizing static inline functions to replace such macros. For example, for a macro such as the one below:: #define test(a) do { } while (0) there would be a warning like below:: WARNING: Argument 'a' is not used in function-like macro. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl **SINGLE_STATEMENT_DO_WHILE_MACRO** For the multi-statement macros, it is necessary to use the do-while loop to avoid unpredictable code paths. The do-while loop helps to group the multiple statements into a single one so that a function-like macro can be used as a function only. But for the single statement macros, it is unnecessary to use the do-while loop. Although the code is syntactically correct but using the do-while loop is redundant. So remove the do-while loop for single statement macros. **WEAK_DECLARATION** Using weak declarations like __attribute__((weak)) or __weak can have unintended link defects. Avoid using them. h]jl��)}(hhh](jq��)}(h**ARRAY_SIZE** The ARRAY_SIZE(foo) macro should be preferred over sizeof(foo)/sizeof(foo[0]) for finding number of elements in an array. The macro is defined in include/linux/kernel.h:: #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) h](jw��)}(h**ARRAY_SIZE**h]j}��)}(hj��h]h ARRAY_SIZE}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hyThe ARRAY_SIZE(foo) macro should be preferred over sizeof(foo)/sizeof(foo[0]) for finding number of elements in an array.h]hyThe ARRAY_SIZE(foo) macro should be preferred over sizeof(foo)/sizeof(foo[0]) for finding number of elements in an array.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(h0The macro is defined in include/linux/kernel.h::h]h/The macro is defined in include/linux/kernel.h:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubj��)}(h2#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))h]h2#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))}hj-��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(h**AVOID_EXTERNS** Function prototypes don't need to be declared extern in .h files. It's assumed by the compiler and is unnecessary. h](jw��)}(h**AVOID_EXTERNS**h]j}��)}(hjM��h]h AVOID_EXTERNS}(hjO��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjK��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjG��ubj��)}(hhh]h)}(hsFunction prototypes don't need to be declared extern in .h files. It's assumed by the compiler and is unnecessary.h]hwFunction prototypes don’t need to be declared extern in .h files. It’s assumed by the compiler and is unnecessary.}(hje��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb��ubah}(h]h ]h"]h$]h&]uh1j��hjG��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**AVOID_L_PREFIX** Local symbol names that are prefixed with `.L` should be avoided, as this has special meaning for the assembler; a symbol entry will not be emitted into the symbol table. This can prevent `objtool` from generating correct unwind info. Symbols with STB_LOCAL binding may still be used, and `.L` prefixed local symbol names are still generally usable within a function, but `.L` prefixed local symbol names should not be used to denote the beginning or end of code regions via `SYM_CODE_START_LOCAL`/`SYM_CODE_END` h](jw��)}(h**AVOID_L_PREFIX**h]j}��)}(hj��h]hAVOID_L_PREFIX}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hLocal symbol names that are prefixed with `.L` should be avoided, as this has special meaning for the assembler; a symbol entry will not be emitted into the symbol table. This can prevent `objtool` from generating correct unwind info.h](h*Local symbol names that are prefixed with }(hj��hhhNhNubj��)}(h`.L`h]h.L}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh should be avoided, as this has special meaning for the assembler; a symbol entry will not be emitted into the symbol table. This can prevent }(hj��hhhNhNubj��)}(h `objtool`h]hobjtool}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh% from generating correct unwind info.}(hj��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hX��Symbols with STB_LOCAL binding may still be used, and `.L` prefixed local symbol names are still generally usable within a function, but `.L` prefixed local symbol names should not be used to denote the beginning or end of code regions via `SYM_CODE_START_LOCAL`/`SYM_CODE_END`h](h6Symbols with STB_LOCAL binding may still be used, and }(hj��hhhNhNubj��)}(h`.L`h]h.L}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubhO prefixed local symbol names are still generally usable within a function, but }(hj��hhhNhNubj��)}(h`.L`h]h.L}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubhc prefixed local symbol names should not be used to denote the beginning or end of code regions via }(hj��hhhNhNubj��)}(h`SYM_CODE_START_LOCAL`h]hSYM_CODE_START_LOCAL}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh/}(hj��hhhNhNubj��)}(h`SYM_CODE_END`h]h SYM_CODE_END}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhM�hj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(h**BIT_MACRO** Defines like: 1 << <digit> could be BIT(digit). The BIT() macro is defined via include/linux/bits.h:: #define BIT(nr) (1UL << (nr)) h](jw��)}(h **BIT_MACRO**h]j}��)}(hj3��h]h BIT_MACRO}(hj5��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj1��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM hj-��ubj��)}(hhh](h)}(heDefines like: 1 << <digit> could be BIT(digit). The BIT() macro is defined via include/linux/bits.h::h]hdDefines like: 1 << <digit> could be BIT(digit). The BIT() macro is defined via include/linux/bits.h:}(hjK��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjH��ubj��)}(h%#define BIT(nr) (1UL << (nr))h]h%#define BIT(nr) (1UL << (nr))}hjY��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM hjH��ubeh}(h]h ]h"]h$]h&]uh1j��hj-��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM hj��ubjq��)}(hXO��**CONST_READ_MOSTLY** When a variable is tagged with the __read_mostly annotation, it is a signal to the compiler that accesses to the variable will be mostly reads and rarely(but NOT never) a write. const __read_mostly does not make any sense as const data is already read-only. The __read_mostly annotation thus should be removed. h](jw��)}(h**CONST_READ_MOSTLY**h]j}��)}(hjy��h]hCONST_READ_MOSTLY}(hj{��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjw��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjs��ubj��)}(hhh](h)}(hWhen a variable is tagged with the __read_mostly annotation, it is a signal to the compiler that accesses to the variable will be mostly reads and rarely(but NOT never) a write.h]hWhen a variable is tagged with the __read_mostly annotation, it is a signal to the compiler that accesses to the variable will be mostly reads and rarely(but NOT never) a write.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj��ubh)}(hconst __read_mostly does not make any sense as const data is already read-only. The __read_mostly annotation thus should be removed.h]hconst __read_mostly does not make any sense as const data is already read-only. The __read_mostly annotation thus should be removed.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hjs��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**DATE_TIME** It is generally desirable that building the same source code with the same set of tools is reproducible, i.e. the output is always exactly the same. The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, and enables warnings if they are used as they can lead to non-deterministic builds. See: https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestamps h](jw��)}(h **DATE_TIME**h]j}��)}(hj��h]h DATE_TIME}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj��ubj��)}(hhh](h)}(hIt is generally desirable that building the same source code with the same set of tools is reproducible, i.e. the output is always exactly the same.h]hIt is generally desirable that building the same source code with the same set of tools is reproducible, i.e. the output is always exactly the same.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hThe kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, and enables warnings if they are used as they can lead to non-deterministic builds.h](hThe kernel does }(hj��hhhNhNubhemphasis)}(h*not*h]hnot}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh use the }(hj��hhhNhNubhliteral)}(h ``__DATE__``h]h__DATE__}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh and }(hj��hhhNhNubj��)}(h ``__TIME__``h]h__TIME__}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj��ubh\ macros, and enables warnings if they are used as they can lead to non-deterministic builds.}(hj��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubh)}(hVSee: https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestampsh](hSee: }(hj-��hhhNhNubj��)}(hQhttps://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestampsh]hQhttps://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestamps}(hj5��hhhNhNubah}(h]h ]h"]h$]h&]refurij7��uh1j��hj-��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**DEFINE_ARCH_HAS** The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong. For big conceptual features use Kconfig symbols instead. And for smaller things where we have compatibility fallback functions but want architectures able to override them with optimized ones, we should either use weak functions (appropriate for some cases), or the symbol that protects them should be the same symbol we use. See: https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/ h](jw��)}(h**DEFINE_ARCH_HAS**h]j}��)}(hj\��h]hDEFINE_ARCH_HAS}(hj^��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjZ��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM(hjV��ubj��)}(hhh](h)}(h6The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong.h]h6The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong.}(hjt��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjq��ubh)}(hXF��For big conceptual features use Kconfig symbols instead. And for smaller things where we have compatibility fallback functions but want architectures able to override them with optimized ones, we should either use weak functions (appropriate for some cases), or the symbol that protects them should be the same symbol we use.h]hXF��For big conceptual features use Kconfig symbols instead. And for smaller things where we have compatibility fallback functions but want architectures able to override them with optimized ones, we should either use weak functions (appropriate for some cases), or the symbol that protects them should be the same symbol we use.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hjq��ubh)}(heSee: https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/h](hSee: }(hj��hhhNhNubj��)}(h`https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/h]h`https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhM(hjq��ubeh}(h]h ]h"]h$]h&]uh1j��hjV��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM(hj��ubjq��)}(hg**DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON** do {} while(0) macros should not have a trailing semicolon. h](jw��)}(h***DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON**h]j}��)}(hj��h]h&DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM+hj��ubj��)}(hhh]h)}(h;do {} while(0) macros should not have a trailing semicolon.h]h;do {} while(0) macros should not have a trailing semicolon.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+hj��ubah}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM+hj��ubjq��)}(h**INIT_ATTRIBUTE** Const init definitions should use __initconst instead of __initdata. Similarly init definitions without const require a separate use of const. h](jw��)}(h**INIT_ATTRIBUTE**h]j}��)}(hj��h]hINIT_ATTRIBUTE}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM2hj��ubj��)}(hhh](h)}(hDConst init definitions should use __initconst instead of __initdata.h]hDConst init definitions should use __initconst instead of __initdata.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hj ��ubh)}(hISimilarly init definitions without const require a separate use of const.h]hISimilarly init definitions without const require a separate use of const.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hj ��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM2hj��ubjq��)}(hX ��**INLINE_LOCATION** The inline keyword should sit between storage class and type. For example, the following segment:: inline static int example_function(void) { ... } should be:: static inline int example_function(void) { ... } h](jw��)}(h**INLINE_LOCATION**h]j}��)}(hj=��h]hINLINE_LOCATION}(hj?��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj;��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMChj7��ubj��)}(hhh](h)}(h=The inline keyword should sit between storage class and type.h]h=The inline keyword should sit between storage class and type.}(hjU��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5hjR��ubh)}(h$For example, the following segment::h]h#For example, the following segment:}(hjc��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hjR��ubj��)}(h8inline static int example_function(void) { ... }h]h8inline static int example_function(void) { ... }}hjq��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM9hjR��ubh)}(h should be::h]h should be:}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hjR��ubj��)}(h8static inline int example_function(void) { ... }h]h8static inline int example_function(void) { ... }}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM@hjR��ubeh}(h]h ]h"]h$]h&]uh1j��hj7��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMChj��ubjq��)}(hX"��**MISPLACED_INIT** It is possible to use section markers on variables in a way which gcc doesn't understand (or at least not the way the developer intended):: static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = { does not put exynos4_plls in the .initdata section. The __initdata marker can be virtually anywhere on the line, except right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise. See: https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/ h](jw��)}(h**MISPLACED_INIT**h]j}��)}(hj��h]hMISPLACED_INIT}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMQhj��ubj��)}(hhh](h)}(hIt is possible to use section markers on variables in a way which gcc doesn't understand (or at least not the way the developer intended)::h]hIt is possible to use section markers on variables in a way which gcc doesn’t understand (or at least not the way the developer intended):}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj��ubj��)}(hDstatic struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {h]hDstatic struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {}hj��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMJhj��ubh)}(hdoes not put exynos4_plls in the .initdata section. The __initdata marker can be virtually anywhere on the line, except right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise.h]hdoes not put exynos4_plls in the .initdata section. The __initdata marker can be virtually anywhere on the line, except right after “struct”. The preferred location is before the “=” sign if there is one, or before the trailing “;” otherwise.}(hj��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhj��ubh)}(hESee: https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/h](hSee: }(hj��hhhNhNubj��)}(h@https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/h]h@https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/}(hj��hhhNhNubah}(h]h ]h"]h$]h&]refurij��uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1hhhhMQhj��ubeh}(h]h ]h"]h$]h&]uh1j��hj��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMQhj��ubjq��)}(hX��**MULTISTATEMENT_MACRO_USE_DO_WHILE** Macros with multiple statements should be enclosed in a do - while block. Same should also be the case for macros starting with `if` to avoid logic defects:: #define macrofun(a, b, c) \ do { \ if (a == 5) \ do_this(b, c); \ } while (0) See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl h](jw��)}(h%**MULTISTATEMENT_MACRO_USE_DO_WHILE**h]j}��)}(hj ��h]h!MULTISTATEMENT_MACRO_USE_DO_WHILE}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj ��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM^hj ��ubj��)}(hhh](h)}(hMacros with multiple statements should be enclosed in a do - while block. Same should also be the case for macros starting with `if` to avoid logic defects::h](hMacros with multiple statements should be enclosed in a do - while block. Same should also be the case for macros starting with }(hj6 ��hhhNhNubj��)}(h`if`h]hif}(hj> ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj6 ��ubh to avoid logic defects:}(hj6 ��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMThj3 ��ubj��)}(h#define macrofun(a, b, c) \ do { \ if (a == 5) \ do_this(b, c); \ } while (0)h]h#define macrofun(a, b, c) \ do { \ if (a == 5) \ do_this(b, c); \ } while (0)}hjV ��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMXhj3 ��ubh)}(hZSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtlh](hSee: }(hjd ��hhhNhNubj��)}(hUhttps://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtlh]hUhttps://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl}(hjl ��hhhNhNubah}(h]h ]h"]h$]h&]refurijn ��uh1j��hjd ��ubeh}(h]h ]h"]h$]h&]uh1hhhhM^hj3 ��ubeh}(h]h ]h"]h$]h&]uh1j��hj ��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM^hj��ubjq��)}(hk**PREFER_FALLTHROUGH** Use the `fallthrough;` pseudo keyword instead of `/* fallthrough */` like comments. h](jw��)}(h**PREFER_FALLTHROUGH**h]j}��)}(hj ��h]hPREFER_FALLTHROUGH}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj ��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMbhj ��ubj��)}(hhh]h)}(hSUse the `fallthrough;` pseudo keyword instead of `/* fallthrough */` like comments.h](hUse the }(hj ��hhhNhNubj��)}(h`fallthrough;`h]h fallthrough;}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj ��ubh pseudo keyword instead of }(hj ��hhhNhNubj��)}(h`/* fallthrough */`h]h/* fallthrough */}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj ��ubh like comments.}(hj ��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMahj ��ubah}(h]h ]h"]h$]h&]uh1j��hj ��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMbhj��ubjq��)}(hX1��**TRAILING_SEMICOLON** Macro definition should not end with a semicolon. The macro invocation style should be consistent with function calls. This can prevent any unexpected code paths:: #define MAC do_something; If this macro is used within a if else statement, like:: if (some_condition) MAC; else do_something; Then there would be a compilation error, because when the macro is expanded there are two trailing semicolons, so the else branch gets orphaned. See: https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/ h](jw��)}(h**TRAILING_SEMICOLON**h]j}��)}(hj ��h]hTRAILING_SEMICOLON}(hj ��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj ��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMwhj ��ubj��)}(hhh](h)}(hMacro definition should not end with a semicolon. The macro invocation style should be consistent with function calls. This can prevent any unexpected code paths::h]hMacro definition should not end with a semicolon. The macro invocation style should be consistent with function calls. This can prevent any unexpected code paths:}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMehj!��ubj��)}(h#define MAC do_something;h]h#define MAC do_something;}hj!��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMihj!��ubh)}(h8If this macro is used within a if else statement, like::h]h7If this macro is used within a if else statement, like:}(hj#!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhj!��ubj��)}(h<if (some_condition) MAC; else do_something;h]h<if (some_condition) MAC; else do_something;}hj1!��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMmhj!��ubh)}(hThen there would be a compilation error, because when the macro is expanded there are two trailing semicolons, so the else branch gets orphaned.h]hThen there would be a compilation error, because when the macro is expanded there are two trailing semicolons, so the else branch gets orphaned.}(hj?!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMshj!��ubh)}(hESee: https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/h](hSee: }(hjM!��hhhNhNubj��)}(h@https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/h]h@https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/}(hjU!��hhhNhNubah}(h]h ]h"]h$]h&]refurijW!��uh1j��hjM!��ubeh}(h]h ]h"]h$]h&]uh1hhhhMwhj!��ubeh}(h]h ]h"]h$]h&]uh1j��hj ��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMwhj��ubjq��)}(hX��**MACRO_ARG_UNUSED** If function-like macros do not utilize a parameter, it might result in a build warning. We advocate for utilizing static inline functions to replace such macros. For example, for a macro such as the one below:: #define test(a) do { } while (0) there would be a warning like below:: WARNING: Argument 'a' is not used in function-like macro. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl h](jw��)}(h**MACRO_ARG_UNUSED**h]j}��)}(hj|!��h]hMACRO_ARG_UNUSED}(hj~!��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjz!��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjv!��ubj��)}(hhh](h)}(hIf function-like macros do not utilize a parameter, it might result in a build warning. We advocate for utilizing static inline functions to replace such macros. For example, for a macro such as the one below::h]hIf function-like macros do not utilize a parameter, it might result in a build warning. We advocate for utilizing static inline functions to replace such macros. For example, for a macro such as the one below:}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj!��ubj��)}(h #define test(a) do { } while (0)h]h #define test(a) do { } while (0)}hj!��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj!��ubh)}(h%there would be a warning like below::h]h$there would be a warning like below:}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!��ubj��)}(h9WARNING: Argument 'a' is not used in function-like macro.h]h9WARNING: Argument 'a' is not used in function-like macro.}hj!��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj!��ubh)}(hZSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtlh](hSee: }(hj!��hhhNhNubj��)}(hUhttps://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtlh]hUhttps://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]refurij!��uh1j��hj!��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!��ubeh}(h]h ]h"]h$]h&]uh1j��hjv!��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(hX��**SINGLE_STATEMENT_DO_WHILE_MACRO** For the multi-statement macros, it is necessary to use the do-while loop to avoid unpredictable code paths. The do-while loop helps to group the multiple statements into a single one so that a function-like macro can be used as a function only. But for the single statement macros, it is unnecessary to use the do-while loop. Although the code is syntactically correct but using the do-while loop is redundant. So remove the do-while loop for single statement macros. h](jw��)}(h#**SINGLE_STATEMENT_DO_WHILE_MACRO**h]j}��)}(hj!��h]hSINGLE_STATEMENT_DO_WHILE_MACRO}(hj!��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj!��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj!��ubj��)}(hhh](h)}(hFor the multi-statement macros, it is necessary to use the do-while loop to avoid unpredictable code paths. The do-while loop helps to group the multiple statements into a single one so that a function-like macro can be used as a function only.h]hFor the multi-statement macros, it is necessary to use the do-while loop to avoid unpredictable code paths. The do-while loop helps to group the multiple statements into a single one so that a function-like macro can be used as a function only.}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"��ubh)}(hBut for the single statement macros, it is unnecessary to use the do-while loop. Although the code is syntactically correct but using the do-while loop is redundant. So remove the do-while loop for single statement macros.h]hBut for the single statement macros, it is unnecessary to use the do-while loop. Although the code is syntactically correct but using the do-while loop is redundant. So remove the do-while loop for single statement macros.}(hj!"��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"��ubeh}(h]h ]h"]h$]h&]uh1j��hj!��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubjq��)}(h**WEAK_DECLARATION** Using weak declarations like __attribute__((weak)) or __weak can have unintended link defects. Avoid using them. h](jw��)}(h**WEAK_DECLARATION**h]j}��)}(hjA"��h]hWEAK_DECLARATION}(hjC"��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj?"��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj;"��ubj��)}(hhh]h)}(hqUsing weak declarations like __attribute__((weak)) or __weak can have unintended link defects. Avoid using them.h]hqUsing weak declarations like __attribute__((weak)) or __weak can have unintended link defects. Avoid using them.}(hjY"��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjV"��ubah}(h]h ]h"]h$]h&]uh1j��hj;"��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj��ubeh}(h]h ]h"]h$]h&]uh1jk��hj��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj��hhubeh}(h]macros-attributes-and-symbolsah ]h"]macros, attributes and symbolsah$]h&]uh1hhj��hhhhhMubh)}(hhh](h)}(hFunctions and Variablesh]hFunctions and Variables}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"��hhhhhMubj3��)}(hX��**CAMELCASE** Avoid CamelCase Identifiers. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#naming **CONST_CONST** Using `const <type> const *` is generally meant to be written `const <type> * const`. **CONST_STRUCT** Using const is generally a good idea. Checkpatch reads a list of frequently used structs that are always or almost always constant. The existing structs list can be viewed from `scripts/const_structs.checkpatch`. See: https://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/ **EMBEDDED_FUNCTION_NAME** Embedded function names are less appropriate to use as refactoring can cause function renaming. Prefer the use of "%s", __func__ to embedded function names. Note that this does not work with -f (--file) checkpatch option as it depends on patch context providing the function name. **FUNCTION_ARGUMENTS** This warning is emitted due to any of the following reasons: 1. Arguments for the function declaration do not follow the identifier name. Example:: void foo (int bar, int baz) This should be corrected to:: void foo(int bar, int baz) 2. Some arguments for the function definition do not have an identifier name. Example:: void foo(int) All arguments should have identifier names. **FUNCTION_WITHOUT_ARGS** Function declarations without arguments like:: int foo() should be:: int foo(void) **GLOBAL_INITIALISERS** Global variables should not be initialized explicitly to 0 (or NULL, false, etc.). Your compiler (or rather your loader, which is responsible for zeroing out the relevant sections) automatically does it for you. **INITIALISED_STATIC** Static variables should not be initialized explicitly to zero. Your compiler (or rather your loader) automatically does it for you. **MULTIPLE_ASSIGNMENTS** Multiple assignments on a single line makes the code unnecessarily complicated. So on a single line assign value to a single variable only, this makes the code more readable and helps avoid typos. **RETURN_PARENTHESES** return is not a function and as such doesn't need parentheses:: return (bar); can simply be:: return bar; h]jl��)}(hhh](jq��)}(hy**CAMELCASE** Avoid CamelCase Identifiers. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#naming h](jw��)}(h **CAMELCASE**h]j}��)}(hj"��h]h CAMELCASE}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj"��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj"��ubj��)}(hhh](h)}(hAvoid CamelCase Identifiers.h]hAvoid CamelCase Identifiers.}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"��ubh)}(hLSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#namingh](hSee: }(hj"��hhhNhNubj��)}(hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#namingh]hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#naming}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]refurij"��uh1j��hj"��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj"��ubeh}(h]h ]h"]h$]h&]uh1j��hj"��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(hf**CONST_CONST** Using `const <type> const *` is generally meant to be written `const <type> * const`. h](jw��)}(h**CONST_CONST**h]j}��)}(hj"��h]h CONST_CONST}(hj"��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj"��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj"��ubj��)}(hhh]h)}(hUUsing `const <type> const *` is generally meant to be written `const <type> * const`.h](hUsing }(hj#��hhhNhNubj��)}(h`const <type> const *`h]hconst <type> const *}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj#��ubh" is generally meant to be written }(hj#��hhhNhNubj��)}(h`const <type> * const`h]hconst <type> * const}(hj,#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj#��ubh.}(hj#��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#��ubah}(h]h ]h"]h$]h&]uh1j��hj"��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(hX7��**CONST_STRUCT** Using const is generally a good idea. Checkpatch reads a list of frequently used structs that are always or almost always constant. The existing structs list can be viewed from `scripts/const_structs.checkpatch`. See: https://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/ h](jw��)}(h**CONST_STRUCT**h]j}��)}(hjV#��h]h CONST_STRUCT}(hjX#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjT#��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjP#��ubj��)}(hhh](h)}(hUsing const is generally a good idea. Checkpatch reads a list of frequently used structs that are always or almost always constant.h]hUsing const is generally a good idea. Checkpatch reads a list of frequently used structs that are always or almost always constant.}(hjn#��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjk#��ubh)}(hPThe existing structs list can be viewed from `scripts/const_structs.checkpatch`.h](h-The existing structs list can be viewed from }(hj|#��hhhNhNubj��)}(h"`scripts/const_structs.checkpatch`h]h scripts/const_structs.checkpatch}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj|#��ubh.}(hj|#��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjk#��ubh)}(hMSee: https://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/h](hSee: }(hj#��hhhNhNubj��)}(hHhttps://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/h]hHhttps://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]refurij#��uh1j��hj#��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjk#��ubeh}(h]h ]h"]h$]h&]uh1j��hjP#��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(hX6��**EMBEDDED_FUNCTION_NAME** Embedded function names are less appropriate to use as refactoring can cause function renaming. Prefer the use of "%s", __func__ to embedded function names. Note that this does not work with -f (--file) checkpatch option as it depends on patch context providing the function name. h](jw��)}(h**EMBEDDED_FUNCTION_NAME**h]j}��)}(hj#��h]hEMBEDDED_FUNCTION_NAME}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj#��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj#��ubj��)}(hhh](h)}(hEmbedded function names are less appropriate to use as refactoring can cause function renaming. Prefer the use of "%s", __func__ to embedded function names.h]hEmbedded function names are less appropriate to use as refactoring can cause function renaming. Prefer the use of “%s”, __func__ to embedded function names.}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#��ubh)}(h{Note that this does not work with -f (--file) checkpatch option as it depends on patch context providing the function name.h]h{Note that this does not work with -f (--file) checkpatch option as it depends on patch context providing the function name.}(hj#��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#��ubeh}(h]h ]h"]h$]h&]uh1j��hj#��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(hX��**FUNCTION_ARGUMENTS** This warning is emitted due to any of the following reasons: 1. Arguments for the function declaration do not follow the identifier name. Example:: void foo (int bar, int baz) This should be corrected to:: void foo(int bar, int baz) 2. Some arguments for the function definition do not have an identifier name. Example:: void foo(int) All arguments should have identifier names. h](jw��)}(h**FUNCTION_ARGUMENTS**h]j}��)}(hj$��h]hFUNCTION_ARGUMENTS}(hj$��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj$��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj $��ubj��)}(hhh](h)}(h<This warning is emitted due to any of the following reasons:h]h<This warning is emitted due to any of the following reasons:}(hj)$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&$��ubj3��)}(hXf��1. Arguments for the function declaration do not follow the identifier name. Example:: void foo (int bar, int baz) This should be corrected to:: void foo(int bar, int baz) 2. Some arguments for the function definition do not have an identifier name. Example:: void foo(int) All arguments should have identifier names. h]j��)}(hhh](j>��)}(hArguments for the function declaration do not follow the identifier name. Example:: void foo (int bar, int baz) This should be corrected to:: void foo(int bar, int baz) h](h)}(hTArguments for the function declaration do not follow the identifier name. Example::h]hSArguments for the function declaration do not follow the identifier name. Example:}(hjB$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>$��ubj��)}(hvoid foo (int bar, int baz)h]hvoid foo (int bar, int baz)}hjP$��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj>$��ubh)}(hThis should be corrected to::h]hThis should be corrected to:}(hj^$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>$��ubj��)}(hvoid foo(int bar, int baz)h]hvoid foo(int bar, int baz)}hjl$��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj>$��ubeh}(h]h ]h"]h$]h&]uh1j=��hj;$��ubj>��)}(hSome arguments for the function definition do not have an identifier name. Example:: void foo(int) All arguments should have identifier names. h](h)}(hUSome arguments for the function definition do not have an identifier name. Example::h]hTSome arguments for the function definition do not have an identifier name. Example:}(hj$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$��ubj��)}(h void foo(int)h]h void foo(int)}hj$��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj$��ubh)}(h+All arguments should have identifier names.h]h+All arguments should have identifier names.}(hj$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$��ubeh}(h]h ]h"]h$]h&]uh1j=��hj;$��ubeh}(h]h ]h"]h$]h&]jS��jT��jU��hjV��jW��uh1j��hj7$��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj&$��ubeh}(h]h ]h"]h$]h&]uh1j��hj $��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(ht**FUNCTION_WITHOUT_ARGS** Function declarations without arguments like:: int foo() should be:: int foo(void) h](jw��)}(h**FUNCTION_WITHOUT_ARGS**h]j}��)}(hj$��h]hFUNCTION_WITHOUT_ARGS}(hj$��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj$��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj$��ubj��)}(hhh](h)}(h.Function declarations without arguments like::h]h-Function declarations without arguments like:}(hj$��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$��ubj��)}(h int foo()h]h int foo()}hj$��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj$��ubh)}(h should be::h]h should be:}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$��ubj��)}(h int foo(void)h]h int foo(void)}hj%��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj$��ubeh}(h]h ]h"]h$]h&]uh1j��hj$��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(h**GLOBAL_INITIALISERS** Global variables should not be initialized explicitly to 0 (or NULL, false, etc.). Your compiler (or rather your loader, which is responsible for zeroing out the relevant sections) automatically does it for you. h](jw��)}(h**GLOBAL_INITIALISERS**h]j}��)}(hj4%��h]hGLOBAL_INITIALISERS}(hj6%��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj2%��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj.%��ubj��)}(hhh]h)}(hGlobal variables should not be initialized explicitly to 0 (or NULL, false, etc.). Your compiler (or rather your loader, which is responsible for zeroing out the relevant sections) automatically does it for you.h]hGlobal variables should not be initialized explicitly to 0 (or NULL, false, etc.). Your compiler (or rather your loader, which is responsible for zeroing out the relevant sections) automatically does it for you.}(hjL%��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjI%��ubah}(h]h ]h"]h$]h&]uh1j��hj.%��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(h**INITIALISED_STATIC** Static variables should not be initialized explicitly to zero. Your compiler (or rather your loader) automatically does it for you. h](jw��)}(h**INITIALISED_STATIC**h]j}��)}(hjl%��h]hINITIALISED_STATIC}(hjn%��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjj%��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjf%��ubj��)}(hhh]h)}(hStatic variables should not be initialized explicitly to zero. Your compiler (or rather your loader) automatically does it for you.h]hStatic variables should not be initialized explicitly to zero. Your compiler (or rather your loader) automatically does it for you.}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj%��ubah}(h]h ]h"]h$]h&]uh1j��hjf%��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(h**MULTIPLE_ASSIGNMENTS** Multiple assignments on a single line makes the code unnecessarily complicated. So on a single line assign value to a single variable only, this makes the code more readable and helps avoid typos. h](jw��)}(h**MULTIPLE_ASSIGNMENTS**h]j}��)}(hj%��h]hMULTIPLE_ASSIGNMENTS}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj%��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj%��ubj��)}(hhh]h)}(hMultiple assignments on a single line makes the code unnecessarily complicated. So on a single line assign value to a single variable only, this makes the code more readable and helps avoid typos.h]hMultiple assignments on a single line makes the code unnecessarily complicated. So on a single line assign value to a single variable only, this makes the code more readable and helps avoid typos.}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj%��ubah}(h]h ]h"]h$]h&]uh1j��hj%��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubjq��)}(h**RETURN_PARENTHESES** return is not a function and as such doesn't need parentheses:: return (bar); can simply be:: return bar; h](jw��)}(h**RETURN_PARENTHESES**h]j}��)}(hj%��h]hRETURN_PARENTHESES}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj%��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj%��ubj��)}(hhh](h)}(h?return is not a function and as such doesn't need parentheses::h]h@return is not a function and as such doesn’t need parentheses:}(hj%��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj%��ubj��)}(h return (bar);h]h return (bar);}hj&��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj%��ubh)}(hcan simply be::h]hcan simply be:}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj%��ubj��)}(h return bar;h]h return bar;}hj&��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj%��ubeh}(h]h ]h"]h$]h&]uh1j��hj%��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj"��ubeh}(h]h ]h"]h$]h&]uh1jk��hj"��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj"��hhubeh}(h]functions-and-variablesah ]h"]functions and variablesah$]h&]uh1hhj��hhhhhMubh)}(hhh](h)}(h Permissionsh]h Permissions}(hjO&��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjL&��hhhhhMubj3��)}(hX-��**DEVICE_ATTR_PERMS** The permissions used in DEVICE_ATTR are unusual. Typically only three permissions are used - 0644 (RW), 0444 (RO) and 0200 (WO). See: https://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributes **EXECUTE_PERMISSIONS** There is no reason for source files to be executable. The executable bit can be removed safely. **EXPORTED_WORLD_WRITABLE** Exporting world writable sysfs/debugfs files is usually a bad thing. When done arbitrarily they can introduce serious security bugs. In the past, some of the debugfs vulnerabilities would seemingly allow any local user to write arbitrary values into device registers - a situation from which little good can be expected to emerge. See: https://lore.kernel.org/linux-arm-kernel/cover.1296818921.git.segoon@openwall.com/ **NON_OCTAL_PERMISSIONS** Permission bits should use 4 digit octal permissions (like 0700 or 0444). Avoid using any other base like decimal. **SYMBOLIC_PERMS** Permission bits in the octal form are more readable and easier to understand than their symbolic counterparts because many command-line tools use this notation. Experienced kernel developers have been using these traditional Unix permission bits for decades and so they find it easier to understand the octal notation than the symbolic macros. For example, it is harder to read S_IWUSR|S_IRUGO than 0644, which obscures the developer's intent rather than clarifying it. See: https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/ h]jl��)}(hhh](jq��)}(h**DEVICE_ATTR_PERMS** The permissions used in DEVICE_ATTR are unusual. Typically only three permissions are used - 0644 (RW), 0444 (RO) and 0200 (WO). See: https://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributes h](jw��)}(h**DEVICE_ATTR_PERMS**h]j}��)}(hjj&��h]hDEVICE_ATTR_PERMS}(hjl&��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjh&��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjd&��ubj��)}(hhh](h)}(hThe permissions used in DEVICE_ATTR are unusual. Typically only three permissions are used - 0644 (RW), 0444 (RO) and 0200 (WO).h]hThe permissions used in DEVICE_ATTR are unusual. Typically only three permissions are used - 0644 (RW), 0444 (RO) and 0200 (WO).}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&��ubh)}(hMSee: https://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributesh](hSee: }(hj&��hhhNhNubj��)}(hHhttps://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributesh]hHhttps://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributes}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]refurij&��uh1j��hj&��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj&��ubeh}(h]h ]h"]h$]h&]uh1j��hjd&��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhja&��ubjq��)}(hy**EXECUTE_PERMISSIONS** There is no reason for source files to be executable. The executable bit can be removed safely. h](jw��)}(h**EXECUTE_PERMISSIONS**h]j}��)}(hj&��h]hEXECUTE_PERMISSIONS}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj&��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj&��ubj��)}(hhh]h)}(h`There is no reason for source files to be executable. The executable bit can be removed safely.h]h`There is no reason for source files to be executable. The executable bit can be removed safely.}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&��ubah}(h]h ]h"]h$]h&]uh1j��hj&��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhja&��ubjq��)}(hX��**EXPORTED_WORLD_WRITABLE** Exporting world writable sysfs/debugfs files is usually a bad thing. When done arbitrarily they can introduce serious security bugs. In the past, some of the debugfs vulnerabilities would seemingly allow any local user to write arbitrary values into device registers - a situation from which little good can be expected to emerge. See: https://lore.kernel.org/linux-arm-kernel/cover.1296818921.git.segoon@openwall.com/ h](jw��)}(h**EXPORTED_WORLD_WRITABLE**h]j}��)}(hj&��h]hEXPORTED_WORLD_WRITABLE}(hj&��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj&��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj&��ubj��)}(hhh](h)}(hXJ��Exporting world writable sysfs/debugfs files is usually a bad thing. When done arbitrarily they can introduce serious security bugs. In the past, some of the debugfs vulnerabilities would seemingly allow any local user to write arbitrary values into device registers - a situation from which little good can be expected to emerge.h]hXJ��Exporting world writable sysfs/debugfs files is usually a bad thing. When done arbitrarily they can introduce serious security bugs. In the past, some of the debugfs vulnerabilities would seemingly allow any local user to write arbitrary values into device registers - a situation from which little good can be expected to emerge.}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj '��ubh)}(hWSee: https://lore.kernel.org/linux-arm-kernel/cover.1296818921.git.segoon@openwall.com/h](hSee: }(hj'��hhhNhNubj��)}(hRhttps://lore.kernel.org/linux-arm-kernel/cover.1296818921.git.segoon@openwall.com/h]hRhttps://lore.kernel.org/linux-arm-kernel/cover.1296818921.git.segoon@openwall.com/}(hj%'��hhhNhNubah}(h]h ]h"]h$]h&]refurij''��uh1j��hj'��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj '��ubeh}(h]h ]h"]h$]h&]uh1j��hj&��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhja&��ubjq��)}(h**NON_OCTAL_PERMISSIONS** Permission bits should use 4 digit octal permissions (like 0700 or 0444). Avoid using any other base like decimal. h](jw��)}(h**NON_OCTAL_PERMISSIONS**h]j}��)}(hjL'��h]hNON_OCTAL_PERMISSIONS}(hjN'��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjJ'��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjF'��ubj��)}(hhh]h)}(hrPermission bits should use 4 digit octal permissions (like 0700 or 0444). Avoid using any other base like decimal.h]h)������rPermission bits should use 4 digit octal permissions (like 0700 or 0444). Avoid using any other base like decimal.}(hjd'��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhja'��ubah}(h]h ]h"]h$]h&]uh1j��hjF'��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhja&��ubjq��)}(hXQ��**SYMBOLIC_PERMS** Permission bits in the octal form are more readable and easier to understand than their symbolic counterparts because many command-line tools use this notation. Experienced kernel developers have been using these traditional Unix permission bits for decades and so they find it easier to understand the octal notation than the symbolic macros. For example, it is harder to read S_IWUSR|S_IRUGO than 0644, which obscures the developer's intent rather than clarifying it. See: https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/ h](jw��)}(h**SYMBOLIC_PERMS**h]j}��)}(hj'��h]hSYMBOLIC_PERMS}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj'��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj~'��ubj��)}(hhh](h)}(hX��Permission bits in the octal form are more readable and easier to understand than their symbolic counterparts because many command-line tools use this notation. Experienced kernel developers have been using these traditional Unix permission bits for decades and so they find it easier to understand the octal notation than the symbolic macros. For example, it is harder to read S_IWUSR|S_IRUGO than 0644, which obscures the developer's intent rather than clarifying it.h]hX��Permission bits in the octal form are more readable and easier to understand than their symbolic counterparts because many command-line tools use this notation. Experienced kernel developers have been using these traditional Unix permission bits for decades and so they find it easier to understand the octal notation than the symbolic macros. For example, it is harder to read S_IWUSR|S_IRUGO than 0644, which obscures the developer’s intent rather than clarifying it.}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'��ubh)}(heSee: https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/h](hSee: }(hj'��hhhNhNubj��)}(h`https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/h]h`https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]refurij'��uh1j��hj'��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj'��ubeh}(h]h ]h"]h$]h&]uh1j��hj~'��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhja&��ubeh}(h]h ]h"]h$]h&]uh1jk��hj]&��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhjL&��hhubeh}(h] permissionsah ]h"] permissionsah$]h&]uh1hhj��hhhhhMubh)}(hhh](h)}(hSpacing and Bracketsh]hSpacing and Brackets}(hj'��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'��hhhhhMubj3��)}(hX\ ��**ASSIGNMENT_CONTINUATIONS** Assignment operators should not be written at the start of a line but should follow the operand at the previous line. **BRACES** The placement of braces is stylistically incorrect. The preferred way is to put the opening brace last on the line, and put the closing brace first:: if (x is true) { we do y } This applies for all non-functional blocks. However, there is one special case, namely functions: they have the opening brace at the beginning of the next line, thus:: int function(int x) { body of function } See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces **BRACKET_SPACE** Whitespace before opening bracket '[' is prohibited. There are some exceptions: 1. With a type on the left:: int [] a; 2. At the beginning of a line for slice initialisers:: [0...10] = 5, 3. Inside a curly brace:: = { [0...10] = 5 } **CONCATENATED_STRING** Concatenated elements should have a space in between. Example:: printk(KERN_INFO"bar"); should be:: printk(KERN_INFO "bar"); **ELSE_AFTER_BRACE** `else {` should follow the closing block `}` on the same line. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces **LINE_SPACING** Vertical space is wasted given the limited number of lines an editor window can display when multiple blank lines are used. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces **OPEN_BRACE** The opening brace should be following the function definitions on the next line. For any non-functional block it should be on the same line as the last construct. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces **POINTER_LOCATION** When using pointer data or a function that returns a pointer type, the preferred use of * is adjacent to the data name or function name and not adjacent to the type name. Examples:: char *linux_banner; unsigned long long memparse(char *ptr, char **retptr); char *match_strdup(substring_t *s); See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces **SPACING** Whitespace style used in the kernel sources is described in kernel docs. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces **TRAILING_WHITESPACE** Trailing whitespace should always be removed. Some editors highlight the trailing whitespace and cause visual distractions when editing files. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces **UNNECESSARY_PARENTHESES** Parentheses are not required in the following cases: 1. Function pointer uses:: (foo->bar)(); could be:: foo->bar(); 2. Comparisons in if:: if ((foo->bar) && (foo->baz)) if ((foo == bar)) could be:: if (foo->bar && foo->baz) if (foo == bar) 3. addressof/dereference single Lvalues:: &(foo->bar) *(foo->bar) could be:: &foo->bar *foo->bar **WHILE_AFTER_BRACE** while should follow the closing bracket on the same line:: do { ... } while(something); See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces h]jl��)}(hhh](jq��)}(h**ASSIGNMENT_CONTINUATIONS** Assignment operators should not be written at the start of a line but should follow the operand at the previous line. h](jw��)}(h**ASSIGNMENT_CONTINUATIONS**h]j}��)}(hj(��h]hASSIGNMENT_CONTINUATIONS}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj(��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj'��ubj��)}(hhh]h)}(huAssignment operators should not be written at the start of a line but should follow the operand at the previous line.h]huAssignment operators should not be written at the start of a line but should follow the operand at the previous line.}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(��ubah}(h]h ]h"]h$]h&]uh1j��hj'��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj'��ubjq��)}(hX��**BRACES** The placement of braces is stylistically incorrect. The preferred way is to put the opening brace last on the line, and put the closing brace first:: if (x is true) { we do y } This applies for all non-functional blocks. However, there is one special case, namely functions: they have the opening brace at the beginning of the next line, thus:: int function(int x) { body of function } See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces h](jw��)}(h **BRACES**h]j}��)}(hj=(��h]hBRACES}(hj?(��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj;(��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM,hj7(��ubj��)}(hhh](h)}(hThe placement of braces is stylistically incorrect. The preferred way is to put the opening brace last on the line, and put the closing brace first::h]hThe placement of braces is stylistically incorrect. The preferred way is to put the opening brace last on the line, and put the closing brace first:}(hjU(��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjR(��ubj��)}(h"if (x is true) { we do y }h]h"if (x is true) { we do y }}hjc(��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhjR(��ubh)}(hThis applies for all non-functional blocks. However, there is one special case, namely functions: they have the opening brace at the beginning of the next line, thus::h]hThis applies for all non-functional blocks. However, there is one special case, namely functions: they have the opening brace at the beginning of the next line, thus:}(hjq(��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hjR(��ubj��)}(h0int function(int x) { body of function }h]h0int function(int x) { body of function }}hj(��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM'hjR(��ubh)}(h_See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh](hSee: }(hj(��hhhNhNubj��)}(hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh]hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]refurij(��uh1j��hj(��ubeh}(h]h ]h"]h$]h&]uh1hhhhM,hjR(��ubeh}(h]h ]h"]h$]h&]uh1j��hj7(��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM,hj'��ubjq��)}(hX ��**BRACKET_SPACE** Whitespace before opening bracket '[' is prohibited. There are some exceptions: 1. With a type on the left:: int [] a; 2. At the beginning of a line for slice initialisers:: [0...10] = 5, 3. Inside a curly brace:: = { [0...10] = 5 } h](jw��)}(h**BRACKET_SPACE**h]j}��)}(hj(��h]h BRACKET_SPACE}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj(��ubah}(h]h ]h"]h$]h&]uh1jv��hhhM<hj(��ubj��)}(hhh](h)}(hOWhitespace before opening bracket '[' is prohibited. There are some exceptions:h]hSWhitespace before opening bracket ‘[’ is prohibited. There are some exceptions:}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM/hj(��ubj��)}(hhh](j>��)}(h&With a type on the left:: int [] a; h](h)}(hWith a type on the left::h]hWith a type on the left:}(hj(��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM2hj(��ubj��)}(h int [] a;h]h int [] a;}hj(��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM4hj(��ubeh}(h]h ]h"]h$]h&]uh1j=��hj(��ubj>��)}(hDAt the beginning of a line for slice initialisers:: [0...10] = 5, h](h)}(h3At the beginning of a line for slice initialisers::h]h2At the beginning of a line for slice initialisers:}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj )��ubj��)}(h [0...10] = 5,h]h [0...10] = 5,}hj)��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM8hj )��ubeh}(h]h ]h"]h$]h&]uh1j=��hj(��ubj>��)}(h,Inside a curly brace:: = { [0...10] = 5 } h](h)}(hInside a curly brace::h]hInside a curly brace:}(hj5)��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hj1)��ubj��)}(h= { [0...10] = 5 }h]h= { [0...10] = 5 }}hjC)��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM<hj1)��ubeh}(h]h ]h"]h$]h&]uh1j=��hj(��ubeh}(h]h ]h"]h$]h&]jS��jT��jU��hjV��jW��uh1j��hj(��ubeh}(h]h ]h"]h$]h&]uh1j��hj(��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhM<hj'��ubjq��)}(h**CONCATENATED_STRING** Concatenated elements should have a space in between. Example:: printk(KERN_INFO"bar"); should be:: printk(KERN_INFO "bar"); h](jw��)}(h**CONCATENATED_STRING**h]j}��)}(hjo)��h]hCONCATENATED_STRING}(hjq)��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjm)��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMFhji)��ubj��)}(hhh](h)}(h?Concatenated elements should have a space in between. Example::h]h>Concatenated elements should have a space in between. Example:}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hj)��ubj��)}(hprintk(KERN_INFO"bar");h]hprintk(KERN_INFO"bar");}hj)��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMBhj)��ubh)}(h should be::h]h should be:}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhj)��ubj��)}(hprintk(KERN_INFO "bar");h]hprintk(KERN_INFO "bar");}hj)��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMFhj)��ubeh}(h]h ]h"]h$]h&]uh1j��hji)��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMFhj'��ubjq��)}(h**ELSE_AFTER_BRACE** `else {` should follow the closing block `}` on the same line. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces h](jw��)}(h**ELSE_AFTER_BRACE**h]j}��)}(hj)��h]hELSE_AFTER_BRACE}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj)��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMKhj)��ubj��)}(hhh](h)}(h>`else {` should follow the closing block `}` on the same line.h](j��)}(h`else {`h]helse {}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj)��ubh! should follow the closing block }(hj)��hhhNhNubj��)}(h`}`h]h}}(hj)��hhhNhNubah}(h]h ]h"]h$]h&]uh1j��hj)��ubh on the same line.}(hj)��hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMIhj)��ubh)}(h_See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh](hSee: }(hj*��hhhNhNubj��)}(hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh]hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces}(hj*��hhhNhNubah}(h]h ]h"]h$]h&]refurij!*��uh1j��hj*��ubeh}(h]h ]h"]h$]h&]uh1hhhhMKhj)��ubeh}(h]h ]h"]h$]h&]uh1j��hj)��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMKhj'��ubjq��)}(h**LINE_SPACING** Vertical space is wasted given the limited number of lines an editor window can display when multiple blank lines are used. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces h](jw��)}(h**LINE_SPACING**h]j}��)}(hjF*��h]h LINE_SPACING}(hjH*��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjD*��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMQhj@*��ubj��)}(hhh](h)}(h{Vertical space is wasted given the limited number of lines an editor window can display when multiple blank lines are used.h]h{Vertical space is wasted given the limited number of lines an editor window can display when multiple blank lines are used.}(hj^*��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhj[*��ubh)}(hLSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh](hSee: }(hjl*��hhhNhNubj��)}(hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh]hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spaces}(hjt*��hhhNhNubah}(h]h ]h"]h$]h&]refurijv*��uh1j��hjl*��ubeh}(h]h ]h"]h$]h&]uh1hhhhMQhj[*��ubeh}(h]h ]h"]h$]h&]uh1j��hj@*��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMQhj'��ubjq��)}(hX��**OPEN_BRACE** The opening brace should be following the function definitions on the next line. For any non-functional block it should be on the same line as the last construct. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces h](jw��)}(h**OPEN_BRACE**h]j}��)}(hj*��h]h OPEN_BRACE}(hj*��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj*��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMXhj*��ubj��)}(hhh](h)}(hThe opening brace should be following the function definitions on the next line. For any non-functional block it should be on the same line as the last construct.h]hThe opening brace should be following the function definitions on the next line. For any non-functional block it should be on the same line as the last construct.}(hj*��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThj*��ubh)}(h_See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh](hSee: }(hj*��hhhNhNubj��)}(hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh]hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces}(hj*��hhhNhNubah}(h]h ]h"]h$]h&]refurij*��uh1j��hj*��ubeh}(h]h ]h"]h$]h&]uh1hhhhMXhj*��ubeh}(h]h ]h"]h$]h&]uh1j��hj*��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMXhj'��ubjq��)}(hX��**POINTER_LOCATION** When using pointer data or a function that returns a pointer type, the preferred use of * is adjacent to the data name or function name and not adjacent to the type name. Examples:: char *linux_banner; unsigned long long memparse(char *ptr, char **retptr); char *match_strdup(substring_t *s); See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces h](jw��)}(h**POINTER_LOCATION**h]j}��)}(hj*��h]hPOINTER_LOCATION}(hj*��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj*��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMdhj*��ubj��)}(hhh](h)}(hWhen using pointer data or a function that returns a pointer type, the preferred use of * is adjacent to the data name or function name and not adjacent to the type name. Examples::h]hWhen using pointer data or a function that returns a pointer type, the preferred use of * is adjacent to the data name or function name and not adjacent to the type name. Examples:}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hj+��ubj��)}(hnchar *linux_banner; unsigned long long memparse(char *ptr, char **retptr); char *match_strdup(substring_t *s);h]hnchar *linux_banner; unsigned long long memparse(char *ptr, char **retptr); char *match_strdup(substring_t *s);}hj+��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM`hj+��ubh)}(hLSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh](hSee: }(hj$+��hhhNhNubj��)}(hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh]hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spaces}(hj,+��hhhNhNubah}(h]h ]h"]h$]h&]refurij.+��uh1j��hj$+��ubeh}(h]h ]h"]h$]h&]uh1hhhhMdhj+��ubeh}(h]h ]h"]h$]h&]uh1j��hj*��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMdhj'��ubjq��)}(h**SPACING** Whitespace style used in the kernel sources is described in kernel docs. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces h](jw��)}(h **SPACING**h]j}��)}(hjS+��h]hSPACING}(hjU+��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjQ+��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMihjM+��ubj��)}(hhh](h)}(hHWhitespace style used in the kernel sources is described in kernel docs.h]hHWhitespace style used in the kernel sources is described in kernel docs.}(hjk+��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghjh+��ubh)}(hLSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh](hSee: }(hjy+��hhhNhNubj��)}(hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh]hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spaces}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]refurij+��uh1j��hjy+��ubeh}(h]h ]h"]h$]h&]uh1hhhhMihjh+��ubeh}(h]h ]h"]h$]h&]uh1j��hjM+��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMihj'��ubjq��)}(h**TRAILING_WHITESPACE** Trailing whitespace should always be removed. Some editors highlight the trailing whitespace and cause visual distractions when editing files. See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces h](jw��)}(h**TRAILING_WHITESPACE**h]j}��)}(hj+��h]hTRAILING_WHITESPACE}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj+��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMphj+��ubj��)}(hhh](h)}(hTrailing whitespace should always be removed. Some editors highlight the trailing whitespace and cause visual distractions when editing files.h]hTrailing whitespace should always be removed. Some editors highlight the trailing whitespace and cause visual distractions when editing files.}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj+��ubh)}(hLSee: https://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh](hSee: }(hj+��hhhNhNubj��)}(hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spacesh]hGhttps://www.kernel.org/doc/html/latest/process/coding-style.html#spaces}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]refurij+��uh1j��hj+��ubeh}(h]h ]h"]h$]h&]uh1hhhhMphj+��ubeh}(h]h ]h"]h$]h&]uh1j��hj+��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMphj'��ubjq��)}(hX��**UNNECESSARY_PARENTHESES** Parentheses are not required in the following cases: 1. Function pointer uses:: (foo->bar)(); could be:: foo->bar(); 2. Comparisons in if:: if ((foo->bar) && (foo->baz)) if ((foo == bar)) could be:: if (foo->bar && foo->baz) if (foo == bar) 3. addressof/dereference single Lvalues:: &(foo->bar) *(foo->bar) could be:: &foo->bar *foo->bar h](jw��)}(h**UNNECESSARY_PARENTHESES**h]j}��)}(hj+��h]hUNNECESSARY_PARENTHESES}(hj+��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj+��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj+��ubj��)}(hhh](h)}(h4Parentheses are not required in the following cases:h]h4Parentheses are not required in the following cases:}(hj,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMshj,��ubj3��)}(hXV��1. Function pointer uses:: (foo->bar)(); could be:: foo->bar(); 2. Comparisons in if:: if ((foo->bar) && (foo->baz)) if ((foo == bar)) could be:: if (foo->bar && foo->baz) if (foo == bar) 3. addressof/dereference single Lvalues:: &(foo->bar) *(foo->bar) could be:: &foo->bar *foo->bar h](j��)}(hhh]j>��)}(h(Function pointer uses:: (foo->bar)(); h](h)}(hFunction pointer uses::h]hFunction pointer uses:}(hj.,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj*,��ubj��)}(h (foo->bar)();h]h (foo->bar)();}hj<,��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMwhj*,��ubeh}(h]h ]h"]h$]h&]uh1j=��hj',��ubah}(h]h ]h"]h$]h&]jS��jT��jU��hjV��jW��uh1j��hj#,��ubj3��)}(hcould be:: foo->bar(); h](h)}(h could be::h]h could be:}(hjZ,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhjV,��ubj��)}(h foo->bar();h]h foo->bar();}hjh,��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhM{hjV,��ubeh}(h]h ]h"]h$]h&]uh1j2��hhhMyhj#,��ubj��)}(hhh]j>��)}(hGComparisons in if:: if ((foo->bar) && (foo->baz)) if ((foo == bar)) h](h)}(hComparisons in if::h]hComparisons in if:}(hj,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hj,��ubj��)}(h/if ((foo->bar) && (foo->baz)) if ((foo == bar))h]h/if ((foo->bar) && (foo->baz)) if ((foo == bar))}hj,��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj,��ubeh}(h]h ]h"]h$]h&]uh1j=��hj|,��ubah}(h]h ]h"]h$]h&]jS��jT��jU��hjV��jW��startKuh1j��hj#,��ubj3��)}(h:could be:: if (foo->bar && foo->baz) if (foo == bar) h](h)}(h could be::h]h could be:}(hj,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,��ubj��)}(h)if (foo->bar && foo->baz) if (foo == bar)h]h)if (foo->bar && foo->baz) if (foo == bar)}hj,��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj,��ubeh}(h]h ]h"]h$]h&]uh1j2��hhhMhj#,��ubj��)}(hhh]j>��)}(hBaddressof/dereference single Lvalues:: &(foo->bar) *(foo->bar) h](h)}(h&addressof/dereference single Lvalues::h]h%addressof/dereference single Lvalues:}(hj,��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,��ubj��)}(h&(foo->bar) *(foo->bar)h]h&(foo->bar) *(foo->bar)}hj,��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj,��ubeh}(h]h ]h"]h$]h&]uh1j=��hj,��ubah}(h]h ]h"]h$]h&]jS��jT��jU��hjV��jW��j,��Kuh1j��hj#,��ubj3��)}(h$could be:: &foo->bar *foo->bar h](h)}(h could be::h]h could be:}(hj-��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-��ubj��)}(h&foo->bar *foo->barh]h&foo->bar *foo->bar}hj-��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhj-��ubeh}(h]h ]h"]h$]h&]uh1j2��hhhMhj#,��ubeh}(h]h ]h"]h$]h&]uh1j2��hhhMuhj,��ubeh}(h]h ]h"]h$]h&]uh1j��hj+��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj'��ubjq��)}(h**WHILE_AFTER_BRACE** while should follow the closing bracket on the same line:: do { ... } while(something); See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces h](jw��)}(h**WHILE_AFTER_BRACE**h]j}��)}(hj?-��h]hWHILE_AFTER_BRACE}(hjA-��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj=-��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj9-��ubj��)}(hhh](h)}(h:while should follow the closing bracket on the same line::h]h9while should follow the closing bracket on the same line:}(hjW-��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjT-��ubj��)}(h$do { ... } while(something);h]h$do { ... } while(something);}hje-��sbah}(h]h ]h"]h$]h&]hhuh1j��hhhMhjT-��ubh)}(h_See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh](hSee: }(hjs-��hhhNhNubj��)}(hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spacesh]hZhttps://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces}(hj{-��hhhNhNubah}(h]h ]h"]h$]h&]refurij}-��uh1j��hjs-��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhjT-��ubeh}(h]h ]h"]h$]h&]uh1j��hj9-��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj'��ubeh}(h]h ]h"]h$]h&]uh1jk��hj'��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj'��hhubeh}(h]spacing-and-bracketsah ]h"]spacing and bracketsah$]h&]uh1hhj��hhhhhMubh)}(hhh](h)}(hOthersh]hOthers}(hj-��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-��hhhhhMubj3��)}(hX ��**CONFIG_DESCRIPTION** Kconfig symbols should have a help text which fully describes it. **CORRUPTED_PATCH** The patch seems to be corrupted or lines are wrapped. Please regenerate the patch file before sending it to the maintainer. **CVS_KEYWORD** Since linux moved to git, the CVS markers are no longer used. So, CVS style keywords ($Id$, $Revision$, $Log$) should not be added. **DEFAULT_NO_BREAK** switch default case is sometimes written as "default:;". This can cause new cases added below default to be defective. A "break;" should be added after empty default statement to avoid unwanted fallthrough. **DOS_LINE_ENDINGS** For DOS-formatted patches, there are extra ^M symbols at the end of the line. These should be removed. **DT_SCHEMA_BINDING_PATCH** DT bindings moved to a json-schema based format instead of freeform text. See: https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html **DT_SPLIT_BINDING_PATCH** Devicetree bindings should be their own patch. This is because bindings are logically independent from a driver implementation, they have a different maintainer (even though they often are applied via the same tree), and it makes for a cleaner history in the DT only tree created with git-filter-branch. See: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters **EMBEDDED_FILENAME** Embedding the complete filename path inside the file isn't particularly useful as often the path is moved around and becomes incorrect. **FILE_PATH_CHANGES** Whenever files are added, moved, or deleted, the MAINTAINERS file patterns can be out of sync or outdated. So MAINTAINERS might need updating in these cases. **MEMSET** The memset use appears to be incorrect. This may be caused due to badly ordered parameters. Please recheck the usage. **NOT_UNIFIED_DIFF** The patch file does not appear to be in unified-diff format. Please regenerate the patch file before sending it to the maintainer. **PRINTF_0XDECIMAL** Prefixing 0x with decimal output is defective and should be corrected. **SPDX_LICENSE_TAG** The source file is missing or has an improper SPDX identifier tag. The Linux kernel requires the precise SPDX identifier in all source files, and it is thoroughly documented in the kernel docs. See: https://www.kernel.org/doc/html/latest/process/license-rules.html **TYPO_SPELLING** Some words may have been misspelled. Consider reviewing them.h]jl��)}(hhh](jq��)}(hY**CONFIG_DESCRIPTION** Kconfig symbols should have a help text which fully describes it. h](jw��)}(h**CONFIG_DESCRIPTION**h]j}��)}(hj-��h]hCONFIG_DESCRIPTION}(hj-��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj-��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj-��ubj��)}(hhh]h)}(hAKconfig symbols should have a help text which fully describes it.h]hAKconfig symbols should have a help text which fully describes it.}(hj-��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-��ubah}(h]h ]h"]h$]h&]uh1j��hj-��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**CORRUPTED_PATCH** The patch seems to be corrupted or lines are wrapped. Please regenerate the patch file before sending it to the maintainer. h](jw��)}(h**CORRUPTED_PATCH**h]j}��)}(hj.��h]hCORRUPTED_PATCH}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj.��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj�.��ubj��)}(hhh]h)}(h{The patch seems to be corrupted or lines are wrapped. Please regenerate the patch file before sending it to the maintainer.h]h{The patch seems to be corrupted or lines are wrapped. Please regenerate the patch file before sending it to the maintainer.}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.��ubah}(h]h ]h"]h$]h&]uh1j��hj�.��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**CVS_KEYWORD** Since linux moved to git, the CVS markers are no longer used. So, CVS style keywords ($Id$, $Revision$, $Log$) should not be added. h](jw��)}(h**CVS_KEYWORD**h]j}��)}(hj>.��h]h CVS_KEYWORD}(hj@.��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj<.��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj8.��ubj��)}(hhh]h)}(hSince linux moved to git, the CVS markers are no longer used. So, CVS style keywords ($Id$, $Revision$, $Log$) should not be added.h]hSince linux moved to git, the CVS markers are no longer used. So, CVS style keywords ($Id$, $Revision$, $Log$) should not be added.}(hjV.��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjS.��ubah}(h]h ]h"]h$]h&]uh1j��hj8.��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**DEFAULT_NO_BREAK** switch default case is sometimes written as "default:;". This can cause new cases added below default to be defective. A "break;" should be added after empty default statement to avoid unwanted fallthrough. h](jw��)}(h**DEFAULT_NO_BREAK**h]j}��)}(hjv.��h]hDEFAULT_NO_BREAK}(hjx.��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjt.��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjp.��ubj��)}(hhh](h)}(hwswitch default case is sometimes written as "default:;". This can cause new cases added below default to be defective.h]h{switch default case is sometimes written as “default:;”. This can cause new cases added below default to be defective.}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.��ubh)}(hWA "break;" should be added after empty default statement to avoid unwanted fallthrough.h]h[A “break;” should be added after empty default statement to avoid unwanted fallthrough.}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.��ubeh}(h]h ]h"]h$]h&]uh1j��hjp.��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h}**DOS_LINE_ENDINGS** For DOS-formatted patches, there are extra ^M symbols at the end of the line. These should be removed. h](jw��)}(h**DOS_LINE_ENDINGS**h]j}��)}(hj.��h]hDOS_LINE_ENDINGS}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj.��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj.��ubj��)}(hhh]h)}(hgFor DOS-formatted patches, there are extra ^M symbols at the end of the line. These should be removed.h]hgFor DOS-formatted patches, there are extra ^M symbols at the end of the line. These should be removed.}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.��ubah}(h]h ]h"]h$]h&]uh1j��hj.��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**DT_SCHEMA_BINDING_PATCH** DT bindings moved to a json-schema based format instead of freeform text. See: https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html h](jw��)}(h**DT_SCHEMA_BINDING_PATCH**h]j}��)}(hj.��h]hDT_SCHEMA_BINDING_PATCH}(hj.��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj.��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj.��ubj��)}(hhh](h)}(hIDT bindings moved to a json-schema based format instead of freeform text.h]hIDT bindings moved to a json-schema based format instead of freeform text.}(hj /��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj /��ubh)}(hSSee: https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.htmlh](hSee: }(hj/��hhhNhNubj��)}(hNhttps://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.htmlh]hNhttps://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html}(hj"/��hhhNhNubah}(h]h ]h"]h$]h&]refurij$/��uh1j��hj/��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj /��ubeh}(h]h ]h"]h$]h&]uh1j��hj.��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(hX��**DT_SPLIT_BINDING_PATCH** Devicetree bindings should be their own patch. This is because bindings are logically independent from a driver implementation, they have a different maintainer (even though they often are applied via the same tree), and it makes for a cleaner history in the DT only tree created with git-filter-branch. See: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters h](jw��)}(h**DT_SPLIT_BINDING_PATCH**h]j}��)}(hjI/��h]hDT_SPLIT_BINDING_PATCH}(hjK/��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjG/��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjC/��ubj��)}(hhh](h)}(hX0��Devicetree bindings should be their own patch. This is because bindings are logically independent from a driver implementation, they have a different maintainer (even though they often are applied via the same tree), and it makes for a cleaner history in the DT only tree created with git-filter-branch.h]hX0��Devicetree bindings should be their own patch. This is because bindings are logically independent from a driver implementation, they have a different maintainer (even though they often are applied via the same tree), and it makes for a cleaner history in the DT only tree created with git-filter-branch.}(hja/��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj^/��ubh)}(hnSee: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submittersh](hSee: }(hjo/��hhhNhNubj��)}(hihttps://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submittersh]hihttps://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters}(hjw/��hhhNhNubah}(h]h ]h"]h$]h&]refurijy/��uh1j��hjo/��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj^/��ubeh}(h]h ]h"]h$]h&]uh1j��hjC/��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**EMBEDDED_FILENAME** Embedding the complete filename path inside the file isn't particularly useful as often the path is moved around and becomes incorrect. h](jw��)}(h**EMBEDDED_FILENAME**h]j}��)}(hj/��h]hEMBEDDED_FILENAME}(hj/��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj/��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj/��ubj��)}(hhh]h)}(hEmbedding the complete filename path inside the file isn't particularly useful as often the path is moved around and becomes incorrect.h]hEmbedding the complete filename path inside the file isn’t particularly useful as often the path is moved around and becomes incorrect.}(hj/��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/��ubah}(h]h ]h"]h$]h&]uh1j��hj/��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**FILE_PATH_CHANGES** Whenever files are added, moved, or deleted, the MAINTAINERS file patterns can be out of sync or outdated. So MAINTAINERS might need updating in these cases. h](jw��)}(h**FILE_PATH_CHANGES**h]j}��)}(hj/��h]hFILE_PATH_CHANGES}(hj/��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj/��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj/��ubj��)}(hhh](h)}(hjWhenever files are added, moved, or deleted, the MAINTAINERS file patterns can be out of sync or outdated.h]hjWhenever files are added, moved, or deleted, the MAINTAINERS file patterns can be out of sync or outdated.}(hj/��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/��ubh)}(h2So MAINTAINERS might need updating in these cases.h]h2So MAINTAINERS might need updating in these cases.}(hj/��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/��ubeh}(h]h ]h"]h$]h&]uh1j��hj/��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**MEMSET** The memset use appears to be incorrect. This may be caused due to badly ordered parameters. Please recheck the usage. h](jw��)}(h **MEMSET**h]j}��)}(hj0��h]hMEMSET}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj0��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj0��ubj��)}(hhh]h)}(hwThe memset use appears to be incorrect. This may be caused due to badly ordered parameters. Please recheck the usage.h]hwThe memset use appears to be incorrect. This may be caused due to badly ordered parameters. Please recheck the usage.}(hj40��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj10��ubah}(h]h ]h"]h$]h&]uh1j��hj0��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h**NOT_UNIFIED_DIFF** The patch file does not appear to be in unified-diff format. Please regenerate the patch file before sending it to the maintainer. h](jw��)}(h**NOT_UNIFIED_DIFF**h]j}��)}(hjT0��h]hNOT_UNIFIED_DIFF}(hjV0��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hjR0��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhjN0��ubj��)}(hhh]h)}(hThe patch file does not appear to be in unified-diff format. Please regenerate the patch file before sending it to the maintainer.h]hThe patch file does not appear to be in unified-diff format. Please regenerate the patch file before sending it to the maintainer.}(hjl0��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhji0��ubah}(h]h ]h"]h$]h&]uh1j��hjN0��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(h\**PRINTF_0XDECIMAL** Prefixing 0x with decimal output is defective and should be corrected. h](jw��)}(h**PRINTF_0XDECIMAL**h]j}��)}(hj0��h]hPRINTF_0XDECIMAL}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj0��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj0��ubj��)}(hhh]h)}(hFPrefixing 0x with decimal output is defective and should be corrected.h]hFPrefixing 0x with decimal output is defective and should be corrected.}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0��ubah}(h]h ]h"]h$]h&]uh1j��hj0��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(hX��**SPDX_LICENSE_TAG** The source file is missing or has an improper SPDX identifier tag. The Linux kernel requires the precise SPDX identifier in all source files, and it is thoroughly documented in the kernel docs. See: https://www.kernel.org/doc/html/latest/process/license-rules.html h](jw��)}(h**SPDX_LICENSE_TAG**h]j}��)}(hj0��h]hSPDX_LICENSE_TAG}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj0��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj0��ubj��)}(hhh](h)}(hThe source file is missing or has an improper SPDX identifier tag. The Linux kernel requires the precise SPDX identifier in all source files, and it is thoroughly documented in the kernel docs.h]hThe source file is missing or has an improper SPDX identifier tag. The Linux kernel requires the precise SPDX identifier in all source files, and it is thoroughly documented in the kernel docs.}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0��ubh)}(hFSee: https://www.kernel.org/doc/html/latest/process/license-rules.htmlh](hSee: }(hj0��hhhNhNubj��)}(hAhttps://www.kernel.org/doc/html/latest/process/license-rules.htmlh]hAhttps://www.kernel.org/doc/html/latest/process/license-rules.html}(hj0��hhhNhNubah}(h]h ]h"]h$]h&]refurij0��uh1j��hj0��ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj0��ubeh}(h]h ]h"]h$]h&]uh1j��hj0��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubjq��)}(hP**TYPO_SPELLING** Some words may have been misspelled. Consider reviewing them.h](jw��)}(h**TYPO_SPELLING**h]j}��)}(hj1��h]h TYPO_SPELLING}(hj1��hhhNhNubah}(h]h ]h"]h$]h&]uh1j|��hj1��ubah}(h]h ]h"]h$]h&]uh1jv��hhhMhj1��ubj��)}(hhh]h)}(h>Some words may have been misspelled. Consider reviewing them.h]h>Some words may have been misspelled. Consider reviewing them.}(hj11��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.1��ubah}(h]h ]h"]h$]h&]uh1j��hj1��ubeh}(h]h ]h"]h$]h&]uh1jp��hhhMhj-��ubeh}(h]h ]h"]h$]h&]uh1jk��hj-��ubah}(h]h ]h"]h$]h&]uh1j2��hhhMhj-��hhubeh}(h]othersah ]h"]othersah$]h&]uh1hhj��hhhhhMubeh}(h]type-descriptionsah ]h"]type descriptionsah$]h&]uh1hhhhhhhhKubeh}(h] checkpatchah ]h"] checkpatchah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_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_handlerj1��error_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}refids}nameids}(jl1��ji1��jl��ji��j��j��jd1��ja1��j ��j ��j��j��j��j��j��j��jA��j>��j��j��j"��j"��jI&��jF&��j'��j'��j-��j-��j\1��jY1��u nametypes}(jl1��jl��j��jd1��j ��j��j��j��jA��j��j"��jI&��j'��j-��j\1��uh}(ji1��hji��hj��jo��ja1��j��j ��jV��j��j ��j��j��j��j��j>��j��j��jD��j"��j��jF&��j"��j'��jL&��j-��j'��jY1��j-��u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK� id_counter collectionsCounter}Rparse_messages](hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "2" (ordinal 2)h]h>Enumerated list start value not ordinal-1: “2” (ordinal 2)}(hj1��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1��ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j1��hj#,��ubj1��)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "3" (ordinal 3)h]h>Enumerated list start value not ordinal-1: “3” (ordinal 3)}(hj2��hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2��ubah}(h]h ]h"]h$]h&]levelKtypej2��sourcehlineKuh1j1��hj#,��ubetransform_messages] transformerN include_log] decorationNhhub.