aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Lindent
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2017-02-22 15:40:20 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 16:41:26 -0800
commit78c5250296c94c0d6bd9e92814e6601ff6c0b18b (patch)
tree31ae67f25b3fee70f9feb0dc13a346f30cafc720 /scripts/Lindent
parent10f24f75b304f6874eacf765d09827a28caea28d (diff)
downloadlinux-yocto-78c5250296c94c0d6bd9e92814e6601ff6c0b18b.tar.gz
linux-yocto-78c5250296c94c0d6bd9e92814e6601ff6c0b18b.tar.bz2
linux-yocto-78c5250296c94c0d6bd9e92814e6601ff6c0b18b.zip
scripts/Lindent: clean up and optimize
* Add a few blank lines to improve readability. * Don't call cut 3 times when once is enough. * Drop a useless semicolon. Link: http://lkml.kernel.org/r/20170104140356.162abab2@endymion Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/Lindent')
-rwxr-xr-xscripts/Lindent14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/Lindent b/scripts/Lindent
index 6d889de4e70b..57b564c24d61 100755
--- a/scripts/Lindent
+++ b/scripts/Lindent
@@ -1,21 +1,25 @@
#!/bin/sh
+
PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
-RES=`indent --version`
+
+RES=`indent --version | cut -d' ' -f3`
if [ "$RES" = "" ]; then
exit 1
fi
-V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
-V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
-V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`
+V1=`echo $RES | cut -d'.' -f1`
+V2=`echo $RES | cut -d'.' -f2`
+V3=`echo $RES | cut -d'.' -f3`
+
if [ $V1 -gt 2 ]; then
PARAM="$PARAM -il0"
elif [ $V1 -eq 2 ]; then
if [ $V2 -gt 2 ]; then
- PARAM="$PARAM -il0";
+ PARAM="$PARAM -il0"
elif [ $V2 -eq 2 ]; then
if [ $V3 -ge 10 ]; then
PARAM="$PARAM -il0"
fi
fi
fi
+
indent $PARAM "$@"