diff mbox series

[WIP,25/30] scripts/coccicheck: modify to handle ${srctree} with trailing slash

Message ID 8cc3f479d76cadf32a80cc4320f59f0c86ba4424.1709508292.git.ehem+linux@m5p.com (mailing list archive)
State New
Headers show
Series Adding trailing slash to $(*tree) | expand

Commit Message

Elliott Mitchell March 1, 2024, 11:50 p.m. UTC
With the modifcation now done, remove compatibility with ${srctree} not
having the trailing slash.

Signed-off-by: Elliott Mitchell <ehem+linux@m5p.com>
---
---
 scripts/coccicheck | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 0395b6f943d4..099ca7c7603b 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -81,7 +81,7 @@  command results in a shift count error.'
 else
     ONLINE=0
     if [ "$KBUILD_EXTMOD" = "" ] ; then
-        OPTIONS="--dir $srctree $COCCIINCLUDE"
+        OPTIONS="--dir ${srctree}. $COCCIINCLUDE"
     else
         OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
     fi
@@ -210,7 +210,7 @@  coccinelle () {
 
     if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
 
-	FILE=${COCCI#${srctree%/}/}
+	FILE=${COCCI#$srctree}
 
 	echo "Processing `basename $COCCI`"
 	echo "with option(s) \"$OPT\""
@@ -273,7 +273,7 @@  else
 fi
 
 if [ "$COCCI" = "" ] ; then
-    for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
+    for f in `find ${srctree}scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
 	coccinelle $f
     done
 else