summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 10:25:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 10:25:42 -0800
commit3544d5ce36f403db6e5c994f526101c870ffe9fe (patch)
tree7259b303e612a67a0ce98108a713f49826723848 /scripts
parent981361604566a28517a518c317943d9b7c392217 (diff)
parente3a22b532080bf32a4d4eb6172c8cb878123e13c (diff)
Merge tag 'cocci-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux
Pull coccinelle updates from Julia Lawall: "This simplifies and clarifies the handling of output generated by Coccinelle that is sent to standard error. By default, this goes to /dev/null. Remind the user of that and encourage them to provide another file name (Benjamin Philip)" * tag 'cocci-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux: Documentation: Coccinelle: document debug log handling scripts: coccicheck: warn on unset debug file scripts: coccicheck: simplify debug file handling
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/coccicheck21
1 files changed, 13 insertions, 8 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 89d591af5f3e..8dd766009de1 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -138,7 +138,7 @@ run_cmd_parmap() {
if [ $VERBOSE -ne 0 ] ; then
echo "Running ($NPROC in parallel): $@"
fi
- if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
+ if [ "$DEBUG_FILE" != "/dev/null" ]; then
echo $@>>$DEBUG_FILE
$@ 2>>$DEBUG_FILE
else
@@ -259,13 +259,18 @@ coccinelle () {
}
-if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
- if [ -f $DEBUG_FILE ]; then
- echo "Debug file $DEBUG_FILE exists, bailing"
- exit
- fi
-else
- DEBUG_FILE="/dev/null"
+if [ "$DEBUG_FILE" = "" ]; then
+ echo 'You have not explicitly specified the debug file to use.'
+ echo 'Using default "/dev/null" as debug file.'
+ echo 'Debug logs will be printed to stdout.'
+ echo 'You can specify the debug file with "make coccicheck DEBUG_FILE=<debug_file>"'
+ echo ''
+ DEBUG_FILE="/dev/null"
+fi
+
+if [ -f $DEBUG_FILE ]; then
+ echo "Debug file $DEBUG_FILE exists, bailing"
+ exit
fi
if [ "$COCCI" = "" ] ; then