Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755025Ab2ECD6a (ORCPT ); Wed, 2 May 2012 23:58:30 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:47747 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753305Ab2ECD63 (ORCPT ); Wed, 2 May 2012 23:58:29 -0400 Message-ID: <1336017507.13866.2.camel@joe2Laptop> Subject: Re: [PATCH] checkpatch: add check for whitespace before semicolon at end-of-line From: Joe Perches To: Eric Nelson Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, u-boot@lists.denx.de, rylv50@freescale.com, marex@denx.de, vapier@gentoo.org Date: Wed, 02 May 2012 20:58:27 -0700 In-Reply-To: <1336015938-3174-1-git-send-email-eric.nelson@boundarydevices.com> References: <1336015938-3174-1-git-send-email-eric.nelson@boundarydevices.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1059 Lines: 37 On Wed, 2012-05-02 at 20:32 -0700, Eric Nelson wrote: > This tests for a bad habits of mine like this: > > return 0 ; > > Signed-off-by: Eric Nelson > --- > scripts/checkpatch.pl | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index a3b9782..0e6977e 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3227,6 +3227,12 @@ sub process { > "Statements terminations use 1 semicolon\n" . $herecurr); > } > > +# check for whitespace before semicolon - not allowed at end-of-line > + if ($line =~ /\s+;$/) { if ($line =~ /\s+;\s*$/) > + WARN("SPACEBEFORE_SEMICOLON", WARN("SPACING", > + "Whitespace before semicolon\n" . $herecurr); > + } > + -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/