summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d574d13ba963..eb8f88787e81 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5637,6 +5637,16 @@ sub process {
5637 } 5637 }
5638 } 5638 }
5639 5639
5640# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
5641 if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) {
5642 my $config = $1;
5643 if (WARN("PREFER_IS_ENABLED",
5644 "Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE\n" . $herecurr) &&
5645 $fix) {
5646 $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)";
5647 }
5648 }
5649
5640# check for case / default statements not preceded by break/fallthrough/switch 5650# check for case / default statements not preceded by break/fallthrough/switch
5641 if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) { 5651 if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) {
5642 my $has_break = 0; 5652 my $has_break = 0;