Skip to content

Commit a5019c7

Browse files
SylfrenaJonathan Corbet
authored andcommitted
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 <[email protected]> Acked-by: Julia Lawall <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
1 parent ec8213f commit a5019c7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Documentation/dev-tools/coccinelle.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,20 @@ For example, to check drivers/net/wireless/ one may write::
175175
make coccicheck M=drivers/net/wireless/
176176

177177
To apply Coccinelle on a file basis, instead of a directory basis, the
178-
following command may be used::
178+
C variable is used by the makefile to select which files to work with.
179+
This variable can be used to run scripts for the entire kernel, a
180+
specific directory, or for a single file.
179181

180-
make C=1 CHECK="scripts/coccicheck"
182+
For example, to check drivers/bluetooth/bfusb.c, the value 1 is
183+
passed to the C variable to check files that make considers
184+
need to be compiled.::
181185

182-
To check only newly edited code, use the value 2 for the C flag, i.e.::
186+
make C=1 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o
183187

184-
make C=2 CHECK="scripts/coccicheck"
188+
The value 2 is passed to the C variable to check files regardless of
189+
whether they need to be compiled or not.::
190+
191+
make C=2 CHECK=scripts/coccicheck drivers/bluetooth/bfusb.o
185192

186193
In these modes, which work on a file basis, there is no information
187194
about semantic patches displayed, and no commit message proposed.

0 commit comments

Comments
 (0)