From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbbEGLVZ (ORCPT ); Thu, 7 May 2015 07:21:25 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:29286 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbbEGLVX (ORCPT ); Thu, 7 May 2015 07:21:23 -0400 Date: Thu, 7 May 2015 14:21:11 +0300 From: Dan Carpenter To: Andy Whitcroft Cc: Joe Perches , linux-kernel@vger.kernel.org Subject: [patch] checkpatch: complain about GW-BASIC style label names Message-ID: <20150507112111.GA21498@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GW-BASIC style label names are quite common. This generates a warning like: WARNING: bad label name #795: FILE: drivers/ata/pata_mpc52xx.c:795: + err2: Signed-off-by: Dan Carpenter diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 89b1df4..ee3fa30 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4023,6 +4023,16 @@ sub process { } } +#avoid GW-BASIC style label names + if ($line=~/^\+\s*(err|error|fail|out)[0-9]+:/) { + if (WARN("LABEL_NAME", + "bad label name\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.)\s+/$1/; + } + } + # return is not a function if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { my $spacing = $1;