diff options
author | Sumera Priyadarsini <sylphrenadin@gmail.com> | 2020-08-11 02:23:50 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2020-08-11 18:37:38 +0200 |
commit | a5019c7f563154bec1cc4026e0883f86126fb2f4 (patch) | |
tree | a40763f24f3c45230a620852092ca7f7a35439f1 /Documentation/dev-tools/coccinelle.rst | |
parent | Core-api: Documentation: Replace deprecated :c:func: Usage (diff) | |
download | linux-a5019c7f563154bec1cc4026e0883f86126fb2f4.tar.xz linux-a5019c7f563154bec1cc4026e0883f86126fb2f4.zip |
documentation: coccinelle: Improve command example for make C={1,2}
Modify coccinelle documentation to further clarify
the usage of the makefile C variable by coccicheck.
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Acked-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/20200811002350.5553-1-sylphrenadin@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/dev-tools/coccinelle.rst')
-rw-r--r-- | Documentation/dev-tools/coccinelle.rst | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Documentation/dev-tools/coccinelle.rst b/Documentation/dev-tools/coccinelle.rst index 6c791af1c859..74c5e6aeeff5 100644 --- a/Documentation/dev-tools/coccinelle.rst +++ b/Documentation/dev-tools/coccinelle.rst @@ -175,13 +175,20 @@ For example, to check drivers/net/wireless/ one may write:: make coccicheck M=drivers/net/wireless/ To apply Coccinelle on a file basis, instead of a directory basis, the -following command may be used:: +C variable is used by the makefile to select which files to work with. +This variable can be used to run scripts for the entire kernel, a +specific directory, or for a single file. - make C=1 CHECK="scripts/coccicheck" +For example, to check drivers/bluetooth/bfusb.c, the value 1 is +passed to the C variable to check files that make considers +need to be compiled.:: -To check only newly edited code, use the value 2 for the C flag, i.e.:: + make C=1 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o - make C=2 CHECK="scripts/coccicheck" +The value 2 is passed to the C variable to check files regardless of +whether they need to be compiled or not.:: + + make C=2 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o In these modes, which work on a file basis, there is no information about semantic patches displayed, and no commit message proposed. |