util/lint/checkpatch.pl: Fix "Invalid color mode" error message
Remove duplicated code: "if ($color =~ /^[01]$/) { $color = !$color; } elsif ($color =~ /^always$/i) { $color = 1; } elsif ($color =~ /^never$/i) { $color = 0; } elsif ($color =~ /^auto$/i) { $color = (-t STDOUT); } else { die "$P: Invalid color mode: $color\n"; }" Change-Id: I5713c364edea806e58df26c3a37b4bba7603ed0a Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64172 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
This commit is contained in:
parent
026978bce5
commit
0014bce46b
|
@ -398,18 +398,6 @@ if ($#ARGV < 0) {
|
|||
# skip TAB size 1 to avoid additional checks on $tabsize - 1
|
||||
die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2);
|
||||
|
||||
if ($color =~ /^[01]$/) {
|
||||
$color = !$color;
|
||||
} elsif ($color =~ /^always$/i) {
|
||||
$color = 1;
|
||||
} elsif ($color =~ /^never$/i) {
|
||||
$color = 0;
|
||||
} elsif ($color =~ /^auto$/i) {
|
||||
$color = (-t STDOUT);
|
||||
} else {
|
||||
die "Invalid color mode: $color\n";
|
||||
}
|
||||
|
||||
sub hash_save_array_words {
|
||||
my ($hashRef, $arrayRef) = @_;
|
||||
|
||||
|
|
Loading…
Reference in New Issue