summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-09-30 15:56:27 -0600
committerMartin Roth <martinroth@google.com>2016-10-03 22:05:54 +0200
commit8bc8be4d0ecd2c939a36f2846ef85d6f469180eb (patch)
treecf381bb61c2f6a58ac15f9566a426d957b275c52 /util
parentfa95625867fa1f373e8c5d8ec160a65e50a3d5c2 (diff)
downloadcoreboot-8bc8be4d0ecd2c939a36f2846ef85d6f469180eb.tar.xz
util/lint/kconfig_lint: change warning levels and text
- Add an exception for MAINBOARD_POWER_ON_AFTER_POWER_FAIL when checking - With those exceptions set, we don't have anymore #define or #ifdef warnings, so turn them to errors so no more can be pushed. - Change the definition of an unused symbol from a warning to a note. There are times when unused symbols are expected. - Upgrade the warning for loading Kconfig files multiple times from a warning to an error. Change-Id: I6dcb06d4f0b099d5ccaf7643e72dd790719bdf58 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/16840 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/lint/kconfig_lint18
1 files changed, 13 insertions, 5 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index 064f3db33f..39a02910ca 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -197,8 +197,11 @@ sub check_for_ifdef {
my $symbol = $3;
if ( ( exists $symbols{$symbol} ) && ( $symbols{$symbol}{type} ne "string" ) ) {
- show_warning( "#ifdef 'CONFIG_$symbol' used at $file:$lineno."
+ # TODO: Remove special check for CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL
+ if ($symbol ne "MAINBOARD_POWER_ON_AFTER_POWER_FAIL") {
+ show_error( "#ifdef 'CONFIG_$symbol' used at $file:$lineno."
. " Symbols of type '$symbols{$symbol}{type}' are always defined." );
+ }
}
}
}
@@ -261,7 +264,10 @@ sub check_for_def {
my $symbol = $3;
if ( ( exists $symbols{$symbol} ) ) {
- show_warning("#define of symbol 'CONFIG_$symbol' used at $file:$lineno.");
+ # TODO: Remove special check for CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL
+ if ($symbol ne "MAINBOARD_POWER_ON_AFTER_POWER_FAIL") {
+ show_error("#define of symbol 'CONFIG_$symbol' used at $file:$lineno.");
+ }
}
else {
show_warning( "#define 'CONFIG_$symbol' used at $file:$lineno."
@@ -460,7 +466,9 @@ sub check_used_symbols {
for ( my $i = 0 ; $i <= $symbols{$key}{count} ; $i++ ) {
my $filename = $symbols{$key}{$i}{file};
my $line_no = $symbols{$key}{$i}{line_no};
- show_warning("Unused symbol '$key' referenced at $filename:$line_no.");
+ if ($show_note_output) {
+ print("#!!!!! Note: Unused symbol '$key' defined at $filename:$line_no.");
+ }
}
}
}
@@ -1162,9 +1170,9 @@ sub load_kconfig_file {
#if the file exists, try to load it.
elsif ( -e "$input_file" ) {
- #throw a warning if the file has already been loaded.
+ #throw an error if the file has already been loaded.
if ( exists $loaded_files{$input_file} ) {
- show_warning("'$input_file' sourced at $loadfile:$loadline was already loaded by $loaded_files{$input_file}");
+ show_error("'$input_file' sourced at $loadfile:$loadline was already loaded by $loaded_files{$input_file}");
}
#load the file's contents and mark the file as loaded for checking later