kbuild: clean up ${quiet} checks in shell scripts
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 17 May 2021 07:03:14 +0000 (16:03 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 May 2021 19:01:50 +0000 (04:01 +0900)
There were efforts to make 'make -s' really silent when it is a
warning-free build.

The conventional way was to let a shell script check ${quiet}, and if
it is 'silent_', suppress the stdout by itself.

With the previous commit, the 'cmd' takes care of it now. The 'cmd' is
also invoked from if_changed, if_changed_dep, and if_changed_rule.

You can omit ${quiet} checks in shell scripts when they are invoked
from the 'cmd' macro.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
kernel/gen_kheaders.sh
scripts/link-vmlinux.sh
scripts/mkcompile_h

index 34a1dc2abc7dde28987cccc035ced5c492c9e6d1..1966a749e0d96da3e77dbe37bb891e6d342b9637 100755 (executable)
@@ -56,9 +56,7 @@ if [ -f kernel/kheaders.md5 ] &&
                exit
 fi
 
-if [ "${quiet}" != "silent_" ]; then
-       echo "  GEN     $tarfile"
-fi
+echo "  GEN     $tarfile"
 
 rm -rf $cpio_dir
 mkdir $cpio_dir
index f4de4c97015bcd2458e052bb2f8d0fc0742eb267..3b342b0b0b38a119bfa3b9aad84b68304044702d 100755 (executable)
@@ -38,9 +38,7 @@ LDFLAGS_vmlinux="$3"
 # Will be supressed by "make -s"
 info()
 {
-       if [ "${quiet}" != "silent_" ]; then
-               printf "  %-7s %s\n" "${1}" "${2}"
-       fi
+       printf "  %-7s %s\n" "${1}" "${2}"
 }
 
 # Generate a linker script to ensure correct ordering of initcalls.
index 4ae735039daf2c554dcc2f6c46879a76fc08f851..06bbf4c2c66c3e4fa99c2b9dbe045e7b6508ad11 100755 (executable)
@@ -9,8 +9,6 @@ PREEMPT_RT=$5
 CC_VERSION="$6"
 LD=$7
 
-vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
-
 # Do not expand names
 set -f
 
@@ -82,7 +80,7 @@ if [ -r $TARGET ] && \
       cmp -s .tmpver.1 .tmpver.2; then
    rm -f .tmpcompile
 else
-   vecho "  UPD     $TARGET"
+   echo "  UPD     $TARGET"
    mv -f .tmpcompile $TARGET
 fi
 rm -f .tmpver.1 .tmpver.2