From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753962AbbC3UtI (ORCPT ); Mon, 30 Mar 2015 16:49:08 -0400 Received: from smtprelay0078.hostedemail.com ([216.40.44.78]:36040 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751029AbbC3UtG (ORCPT ); Mon, 30 Mar 2015 16:49:06 -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:3866:3868:3871:3874:4250:4321:5007:6119:6120:6261:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12043:12438:12517:12519:12740:13069:13255:13311:13357:19904:19999: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: music58_4f42846cbbb22 X-Filterd-Recvd-Size: 2032 Message-ID: <1427748543.14276.32.camel@perches.com> Subject: Re: [RFC 1/1 linux-next] 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: Mon, 30 Mar 2015 13:49:03 -0700 In-Reply-To: <1427747804-20714-1-git-send-email-fabf@skynet.be> References: <1427747804-20714-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 Mon, 2015-03-30 at 22:36 +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 [] > -#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 -ci "#include " $checkfile`; This won't work with #include forms like: #include or when checkpatch is run from somewhere other than the top of tree. why the -i? > 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",