Skip to contentSkip to conversation

scripts: add no-warning option to the checkpatch script

PATCH Superseded Marco Stornelli 2 participants 2 messages Dec 15, 2010 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: add no-warning option to the checkpatch script

From: Marco Stornelli <[email protected]>

Add no-warning option to the checkpatch script.

---

scripts/checkpatch.pl +4 -1
@@ -15,6 +15,7 @@ my $V = '0.30';
 use Getopt::Long qw(:config no_auto_abbrev);
 
 my $quiet = 0;
+my $chk_warn = 1;
 my $tree = 1;
 my $chk_signoff = 1;
 my $chk_patch = 1;
@@ -39,6 +40,7 @@ Version: $V
 
 Options:
   -q, --quiet                quiet
+  --no-warning               do not report warnings
   --no-tree                  run without a kernel tree
   --no-signoff               do not check for 'Signed-off-by' line
   --patch                    treat FILE as patchfile (default)
@@ -65,6 +67,7 @@ EOM
 
 GetOptions(
 	'q|quiet+'	=> \$quiet,
+	'warning!'	=> \$chk_warn,
 	'tree!'		=> \$tree,
 	'signoff!'	=> \$chk_signoff,
 	'patch!'	=> \$chk_patch,
@@ -1087,7 +1090,7 @@ sub ERROR {
 	}
 }
 sub WARN {
-	if (report("WARNING: $_[0]\n")) {
+	if ($chk_warn && report("WARNING: $_[0]\n")) {
 		our $clean = 0;
 		our $cnt_warn++;
 	}
#1 lore raw

You probably wanted to copy Joe Perches too.

+Joe.

Quoted 49 lines · Marco Stornelli

From: Marco Stornelli <[email protected]>

Add no-warning option to the checkpatch script.

---

scripts/checkpatch.pl  2010-11-28 12:40:24.000000000 +0100 renamed from scripts/checkpatch.pl     2010-10-20 22:30:22.000000000 +0200 +1 -0
@@ -15,6 +15,7 @@ my $V = '0.30';
  use Getopt::Long qw(:config no_auto_abbrev);
 
  my $quiet = 0;
+my $chk_warn = 1;
  my $tree = 1;
  my $chk_signoff = 1;
  my $chk_patch = 1;
@@ -39,6 +40,7 @@ Version: $V
 

 Options:
  -q, --quiet                quiet
+  --no-warning               do not report warnings --no-tree                  run without a kernel tree --no-signoff               do not check for 'Signed-off-by' line --patch                    treat FILE as patchfile (default)

scripts/checkpatch.pl  2010-11-28 12:40:24.000000000 +0100 renamed from scripts/checkpatch.pl     2010-10-20 22:30:22.000000000 +0200 +0 -0
@@ -65,6 +67,7 @@ EOM
 

 GetOptions(
       'q|quiet+'      => \$quiet,
+       'warning!'      => \$chk_warn,
       'tree!'         => \$tree,
       'signoff!'      => \$chk_signoff,
       'patch!'        => \$chk_patch,

scripts/checkpatch.pl  2010-11-28 12:40:24.000000000 +0100 renamed from scripts/checkpatch.pl     2010-10-20 22:30:22.000000000 +0200 +1 -2
@@ -1087,7 +1090,7 @@ sub ERROR {
        }
  }
  sub WARN {
-       if (report("WARNING: $_[0]\n")) {
+       if ($chk_warn && report("WARNING: $_[0]\n")) {
                our $clean = 0;
                our $cnt_warn++;
        }
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/