From patchwork Fri Apr 1 15:20:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 89295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E4EABB6F83 for ; Sat, 2 Apr 2011 02:34:48 +1100 (EST) Received: from localhost ([127.0.0.1]:39543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5gJX-0006rO-JA for incoming@patchwork.ozlabs.org; Fri, 01 Apr 2011 11:31:07 -0400 Received: from [140.186.70.92] (port=52162 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5gDH-0004GZ-Dc for qemu-devel@nongnu.org; Fri, 01 Apr 2011 11:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5gD8-0002ZP-Ao for qemu-devel@nongnu.org; Fri, 01 Apr 2011 11:24:31 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:46453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5gD8-0002Z8-4r for qemu-devel@nongnu.org; Fri, 01 Apr 2011 11:24:30 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p31F826W029945 for ; Fri, 1 Apr 2011 09:08:02 -0600 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p31FL81E064990 for ; Fri, 1 Apr 2011 09:21:09 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p31FL7On022731 for ; Fri, 1 Apr 2011 09:21:07 -0600 Received: from localhost.localdomain (sig-9-76-192-60.mts.ibm.com [9.76.192.60]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p31FL5Gn022479; Fri, 1 Apr 2011 09:21:06 -0600 From: Michael Roth To: qemu-devel@nongnu.org Date: Fri, 1 Apr 2011 10:20:54 -0500 Message-Id: <1301671255-27717-2-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1301671255-27717-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1301671255-27717-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.110.160 Cc: mdroth@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 1/2] checkpatch.pl: add --no-fail-on-warn option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org checkpatch.pl complains about some things that are not strictly against QEMU's coding style guidelines. It's good to print these, but we shouldn't force a fail on these as it makes it difficult to automate checkpatch.pl runs. If we're supposed to fail on these cases, they should be handled as errors rather than warnings. For now, however, just add a flag that enables this behavior. Any functionality triggered by $clean = 0 is still handled as it was previously. Signed-off-by: Michael Roth --- scripts/checkpatch.pl | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 075b614..770d534 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -28,6 +28,7 @@ my $mailback = 0; my $summary_file = 0; my $root; my %debug; +my $no_fail_on_warn = 0; my $help = 0; sub help { @@ -55,6 +56,7 @@ Options: is all off) --test-only=WORD report only warnings/errors containing WORD literally + --no-fail-on-warn print warnings, but don't fail on them -h, --help, --version display this help and exit When FILE is - read standard input. @@ -80,6 +82,7 @@ GetOptions( 'debug=s' => \%debug, 'test-only=s' => \$tst_only, + 'no-fail-on-warn' => \$no_fail_on_warn, 'h|help' => \$help, 'version' => \$help ) or help(1); @@ -1104,18 +1107,23 @@ sub report_dump { sub ERROR { if (report("ERROR: $_[0]\n")) { our $clean = 0; + our $passable = 0; our $cnt_error++; } } sub WARN { if (report("WARNING: $_[0]\n")) { our $clean = 0; + if ($no_fail_on_warn == 0) { + our $passable = 0; + } our $cnt_warn++; } } sub CHK { if ($check && report("CHECK: $_[0]\n")) { our $clean = 0; + our $passable = 0; our $cnt_chk++; } } @@ -1162,6 +1170,7 @@ sub process { my $stashindent=0; our $clean = 1; + our $passable = 1; my $signoff = 0; my $is_patch = 0; @@ -2906,5 +2915,5 @@ sub process { print "CHECKPATCH in MAINTAINERS.\n"; } - return $clean; + return $passable; }