From 0014bce46be97f28594248bbf9951bd0d0c4bf17 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 8 May 2022 10:07:12 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64172 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- util/lint/checkpatch.pl | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 81fda35d33..a7a31db144 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -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) = @_; -- cgit v1.2.3