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: 167401 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp965351ilk; Fri, 21 Jun 2019 09:40:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKe5nk5a65CBdVFVNh2p0W+56tmAlnFtkTwzo+75T5cK44cXpxtN9sNYAf/AKFXTS0j/9z X-Received: by 2002:a63:9d43:: with SMTP id i64mr17961581pgd.404.1561135212205; Fri, 21 Jun 2019 09:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561135212; cv=none; d=google.com; s=arc-20160816; b=eQolG1CtX5bNrp5SLXfcqNfnNHzv6eE1L2Ec0F0fdg6WtmdD0MaLE5r0/vrzJasE0M 5o+6KiKYvuktUgJdNrSD/yIxBsSlMbcjChD2XX4/EZ8uSA0t+tUFjZk6rffnMjdhPaDK azre/rwz4u/Rr6vDtzNxFwXAlgtUs92s6ZIvSonKmfp5v3r9ATKtFt0R0xGij+pk3u0S ijSGRcQI2HXDhQBK4/aB8REkY/SBeOapAzWs4bB4UvqDD8da1vnZtWqZsj39ZL15Ok5K 81QC19I5Vv1cd+4qROnoxfkBIKkF2Db+Tn6rxY84aEnc3uf/8Z0qQGOqr2FowW0y263Y iklQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=ozhNqk/jJbRlOJsA1fVCfpWIUlNkHQWb4qUWtLdFnnk=; b=yGcOXt+fwHpWsV7pdZ4pWOa9W7yJt4p43do+RrxKmknGdtb8eqHxU4G6Xp4Xo0Ldo6 sm8RgmDAKPyZnV6545QIjoM+SklK9shqu/OsJEkBHYeg1QGYN3E0Z7pTPUcwbEa6RSQc NLxa11QKsqye+8N2w65ezVLwhiLruikFkMUtvPXuxqHccNh2CXkmusslnZ/PtSZY2Sqf Ee6ByZM4mpNL67d0uSLDFZn2VbK/io03G6GHfMia/pmB4HS85L8PqGtoNssgkJ+cmjL/ TKGo3byJnU6DZ6PvfDTrYqZH8/9YemV5/A5CLddKD1a/EqQdZTLEZILhv93iis+lg6Ka b3KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eIkfdIS+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z191si1065163pgd.446.2019.06.21.09.40.11; Fri, 21 Jun 2019 09:40:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eIkfdIS+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726188AbfFUQkK (ORCPT + 30 others); Fri, 21 Jun 2019 12:40:10 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:60112 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfFUQkK (ORCPT ); Fri, 21 Jun 2019 12:40:10 -0400 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 Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Michal Marek , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.1 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))