From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbbC3Ugw (ORCPT ); Mon, 30 Mar 2015 16:36:52 -0400 Received: from mailrelay107.isp.belgacom.be ([195.238.20.134]:49290 "EHLO mailrelay107.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753520AbbC3Ugu (ORCPT ); Mon, 30 Mar 2015 16:36:50 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=pojTLeLEEG+IB9MeyQ9xnWKWJHiyH+4Hnj5iAYu/pCk= c=1 sm=2 a=SP5AAPQoICiYEzk6x5gA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DvBgCdshlV/yA2QFdcgwZSXLIRBQEBAQEBAQUBe5IbhXuBPU0BAQEBAQF9hHEjgRo3iDMBy3Ushg+KEh2EFwWUTYYDgVaSXyKBRW2BPjwxgkMBAQE From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Fabian Frederick , Andy Whitcroft , Joe Perches Subject: [RFC 1/1 linux-next] checkpatch: don't ask for asm/file.h to linux/file.h unconditionally Date: Mon, 30 Mar 2015 22:36:43 +0200 Message-Id: <1427747804-20714-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) Signed-off-by: Fabian Frederick --- scripts/checkpatch.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d54a814..5824829 100755 --- 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 -ci "#include " $checkfile`; 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", -- 1.9.1