From patchwork Fri Jun 21 16:39:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11010397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7F2F6C5 for ; Fri, 21 Jun 2019 16:40:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C63DB28B2D for ; Fri, 21 Jun 2019 16:40:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA63128B53; Fri, 21 Jun 2019 16:40:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 679C828B2D for ; Fri, 21 Jun 2019 16:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=H5IXjt9wQ+XU3xMthFBPKg3vG4ic60wCU6qL1I6Fcsc=; b=eeJ UQtDrJGz7pc9KS1HQ5Q8KJbtZ5Dg/QaoM0AfaeMPp2zp5XjywDUDfd7Xm9d7F+GcAT2kct4+7Lxka p4n6Mf2AkT409bHB/yvDF+BSSkA31cPr84GXbMa9gQn6ZWaCb/fzsd1wcTMprOQq1njLgBhuVPAfi QSiJgDl6eYQu7I+VSx3WyP7zfhYsp/Sud34S/E3W7AkbZ0ElZM8X6NJ7/D4nDAOWWYpixTpzE9dQt 61K799VImT3r7siWM/ZEl410xFsJpPHE9fr5w4RY/x6pZlyuUpbf524rHhSdzrVIKi+5nhu2fDjA4 vIodG60QGKMP0KxE11YFF/B7yJFS6LQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1heMaG-000770-2Q; Fri, 21 Jun 2019 16:40:16 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1heMZu-0005e7-68; Fri, 21 Jun 2019 16:39:56 +0000 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-12.nifty.com with ESMTP id x5LGdXbA030778; Sat, 22 Jun 2019 01:39:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x5LGdXbA030778 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1561135174; bh=ozhNqk/jJbRlOJsA1fVCfpWIUlNkHQWb4qUWtLdFnnk=; h=From:To:Cc:Subject:Date:From; b=eIkfdIS+O26Z2YOKvyyUQPDJEfS8R4Fhs0ivGILBOqSQUUm5uWKbiPvKnX/+WtwFg bR6tU9HZ4+pLdiRnLxprJkokHFgCtkFoMktC1DDnmtum2THZ3CVntvFIDae0PqQwJz UKsDDf8vlHPw6lhKvHOC5bPX9K+MKp9Zup6GlavY83airXFt5PwUrWGHKBwQLMLuVU kmDNdZ4svkbDbE9jeS3mqKjBXcv5ohpvAiAgS9EWfEq5D4E5/eDRtcyqvkzithnuhb xtCZFMEJe7KxegEtkFkx2ypPYLJzg/fgwsSocOPsVDT+rg+2BXnDFsGwl+LcF3XH9e bZh+TEYRkfgHg== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Subject: [PATCH] kbuild: compile-test global headers to ensure they are self-contained Date: Sat, 22 Jun 2019 01:39:31 +0900 Message-Id: <20190621163931.19397-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190621_093954_556610_37188B3A X-CRM114-Status: UNSURE ( 8.03 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Make as many headers self-contained as possible so that they can be included without relying on a specific include order. This commit compiles only a few headers, but it is a good start point. Signed-off-by: Masahiro Yamada --- Makefile | 1 + include/Makefile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 include/Makefile diff --git a/Makefile b/Makefile index c23f5e8381ad..82c1722dd9e9 100644 --- a/Makefile +++ b/Makefile @@ -610,6 +610,7 @@ drivers-y := drivers/ sound/ drivers-$(CONFIG_SAMPLES) += samples/ net-y := net/ libs-y := lib/ +libs-$(CONFIG_HEADER_TEST) += include/ core-y := usr/ virt-y := virt/ endif # KBUILD_EXTMOD diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 000000000000..68a76ac732c3 --- /dev/null +++ b/include/Makefile @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-only + +# extend the test coverage when existing errors are fixed + +header-test += linux/w*.h +header-test += linux/x*.h +header-test += linux/y*.h +header-test += ras/*.h +header-test += soc/at91/*.h +header-test += soc/bcm2835/*.h +header-test += soc/mediatek/*.h +header-test += soc/sa1100/*.h + +all-headers = $(patsubst $(srctree)/include/%,%,\ + $(wildcard $(addprefix $(srctree)/include/, $(header-test)))) + +# Do not include directly +no-header-test += linux/compiler-clang.h +no-header-test += linux/compiler-gcc.h +no-header-test += linux/patchkey.h +no-header-test += linux/rwlock_api_smp.h +no-header-test += linux/spinlock_types_up.h +no-header-test += linux/spinlock_up.h +no-header-test += linux/wimax/debug.h +no-header-test += rdma/uverbs_named_ioctl.h + +# Conditionally included +no-header-test += linux/byteorder/big_endian.h +no-header-test += linux/byteorder/little_endian.h + +header-test-y = $(filter-out $(no-header-test), $(all-headers))