From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535AbbCaTOP (ORCPT ); Tue, 31 Mar 2015 15:14:15 -0400 Received: from smtprelay0096.hostedemail.com ([216.40.44.96]:36610 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751631AbbCaTON (ORCPT ); Tue, 31 Mar 2015 15:14:13 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:960:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3867:3868:3871:3872:3874:4250:4321:5007:6261:10004:10400:10848:11026:11232:11473:11658:11914:12043:12295:12438:12517:12519:12740:13019:13069:13255:13311:13357: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: heart70_24aa3ff452c0b X-Filterd-Recvd-Size: 2056 Message-ID: <1427829250.18175.13.camel@perches.com> Subject: Re: [PATCH V2] checkpatch: don't ask for asm/file.h to linux/file.h unconditionally From: Joe Perches To: Fabian Frederick Cc: linux-kernel@vger.kernel.org, Andy Whitcroft Date: Tue, 31 Mar 2015 12:14:10 -0700 In-Reply-To: <1427828812-1210-1-git-send-email-fabf@skynet.be> References: <1427828812-1210-1-git-send-email-fabf@skynet.be> 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 On Tue, 2015-03-31 at 21:06 +0200, Fabian Frederick wrote: > Currently checkpatch warns when asm/file.h is included and linux/file.h > exists. That conversion can be made when linux/file.h includes asm/file.h > which is not always the case.(See signal.h) [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -4242,13 +4242,16 @@ sub process { > } > } > > -#warn if is #included and is available (uses RAW line) > +# warn if is #included and is available and includes > +# itself (uses RAW line) > if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\}) { > my $file = "$1.h"; > my $checkfile = "include/linux/$file"; > + my $asminclude = `grep -Ec "#include\\s+" $root/$checkfile`; I think it'd be better to move this into the if below so that the grep is done only when $root/$checkfile exists. > if (-f "$root/$checkfile" && > $realfile ne $checkfile && > - $1 !~ /$allowed_asm_includes/) > + $1 !~ /$allowed_asm_includes/ && > + $asminclude > 0 ) > { > if ($realfile =~ m{^arch/}) { > CHK("ARCH_INCLUDE_LINUX",