Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705AbbDCSgI (ORCPT ); Fri, 3 Apr 2015 14:36:08 -0400 Received: from smtprelay0121.hostedemail.com ([216.40.44.121]:36398 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751925AbbDCSgE (ORCPT ); Fri, 3 Apr 2015 14:36:04 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:800:960:966:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3653:3865:3872:3874:4321:4385:4605:5007:6261:8531:10004:10400:10848:11026:11232:11658:11914:12043:12296:12517:12519:12555:12679:13069:13161:13221:13229:13311:13357:14394:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: shame91_178e1d277cc4f X-Filterd-Recvd-Size: 3058 Message-ID: <1428086160.13180.55.camel@perches.com> Subject: [PATCH] checkpatch: Add #define foo "string" long line exception From: Joe Perches To: Andrew Morton Cc: Andy Whitcroft , Madalin-Cristian Bucur , LKML Date: Fri, 03 Apr 2015 11:36:00 -0700 In-Reply-To: <1428083639.13180.44.camel@perches.com> References: <1427905196-27778-1-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-2-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-3-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-4-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-5-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-6-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-7-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-8-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-9-git-send-email-madalin.bucur@freescale.com> <1428079621.13180.10.camel@perches.com> <1428083639.13180.44.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 43 There are #defines with long string constants like: #define foo "some really long string > 80 columns" Add a long line exception for them. Miscellanea: Use the $String variable for slightly better readability Reported-by: Madalin-Cristian Bucur Signed-off-by: Joe Perches --- > > WARNING: line over 80 characters > > #22: FILE: drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h:47: > > +#define TR_FMT "[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u, status=0x%08x" > > That's a checkpatch defect. Thanks. I'll see about fixing it. scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9a8b2bd..36d7e70 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2513,8 +2513,9 @@ sub process { #line length limit if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && $rawline !~ /^.\s*\*\s*\@$Ident\s/ && - !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ || - $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && + !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?$String\s*(?:|,|\)\s*;)\s*$/ || + $line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ || + $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) && $length > $max_line_length) { WARN("LONG_LINE", -- 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/