Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: do not print extra logs for V=2

Some scripts increase the verbose level when V=1, but others when
not V=0.

I think the former is correct because V=2 is not a log level but
a switch to print the reason for rebuilding.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+15 -13
+1 -1
Documentation/Makefile
··· 28 28 PDFLATEX = xelatex 29 29 LATEXOPTS = -interaction=batchmode -no-shell-escape 30 30 31 - ifeq ($(KBUILD_VERBOSE),0) 31 + ifeq ($(findstring 1, $(KBUILD_VERBOSE)),) 32 32 SPHINXOPTS += "-q" 33 33 endif 34 34
+4 -5
arch/powerpc/kernel/prom_init_check.sh
··· 51 51 # a leading . on the name, so strip it off here. 52 52 UNDEF="${UNDEF#.}" 53 53 54 - if [ $KBUILD_VERBOSE ]; then 55 - if [ $KBUILD_VERBOSE -ne 0 ]; then 56 - echo "Checking prom_init.o symbol '$UNDEF'" 57 - fi 58 - fi 54 + case "$KBUILD_VERBOSE" in 55 + *1*) 56 + echo "Checking prom_init.o symbol '$UNDEF'" ;; 57 + esac 59 58 60 59 OK=0 61 60 for WHITE in $WHITELIST
+6 -3
certs/extract-cert.c
··· 78 78 static const char *key_pass; 79 79 static BIO *wb; 80 80 static char *cert_dst; 81 - static int kbuild_verbose; 81 + static bool verbose; 82 82 83 83 static void write_cert(X509 *x509) 84 84 { ··· 90 90 } 91 91 X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf)); 92 92 ERR(!i2d_X509_bio(wb, x509), "%s", cert_dst); 93 - if (kbuild_verbose) 93 + if (verbose) 94 94 fprintf(stderr, "Extracted cert: %s\n", buf); 95 95 } 96 96 97 97 int main(int argc, char **argv) 98 98 { 99 99 char *cert_src; 100 + char *verbose_env; 100 101 101 102 OpenSSL_add_all_algorithms(); 102 103 ERR_load_crypto_strings(); 103 104 ERR_clear_error(); 104 105 105 - kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0"); 106 + verbose_env = getenv("KBUILD_VERBOSE"); 107 + if (verbose_env && strchr(verbose_env, '1')) 108 + verbose = true; 106 109 107 110 key_pass = getenv("KBUILD_SIGN_PIN"); 108 111
+2 -2
scripts/asn1_compiler.c
··· 567 567 int fd; 568 568 569 569 kbuild_verbose = getenv("KBUILD_VERBOSE"); 570 - if (kbuild_verbose) 571 - verbose_opt = atoi(kbuild_verbose); 570 + if (kbuild_verbose && strchr(kbuild_verbose, '1')) 571 + verbose_opt = true; 572 572 573 573 while (argc > 4) { 574 574 if (strcmp(argv[1], "-v") == 0)
+2 -2
scripts/kernel-doc
··· 175 175 my ($type, $declaration_name, $return_type); 176 176 my ($newsection, $newcontents, $prototype, $brcount, %source_map); 177 177 178 - if (defined($ENV{'KBUILD_VERBOSE'})) { 179 - $verbose = "$ENV{'KBUILD_VERBOSE'}"; 178 + if (defined($ENV{'KBUILD_VERBOSE'}) && $ENV{'KBUILD_VERBOSE'} =~ '1') { 179 + $verbose = 1; 180 180 } 181 181 182 182 if (defined($ENV{'KCFLAGS'})) {