From patchwork Mon Jul 16 11:30:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 142007 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2306307ljj; Mon, 16 Jul 2018 04:31:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfZnGX5qHS8hn3lF3AJ/XBhYwspTscJkQhQh7q5X19CoFB92F0w3yuHQiVQb9cX03SXesGZ X-Received: by 2002:a62:d10b:: with SMTP id z11-v6mr17698566pfg.255.1531740679395; Mon, 16 Jul 2018 04:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531740679; cv=none; d=google.com; s=arc-20160816; b=oLXVt4WqQF8Nwcvl0nhAsSNaKwDFMu7BMPYZGSbQn96J/QFLsn/gjJoqGTpOpK8h5G /1UpLQs4nqxZs03aSITd1FuT1g9+iSPNI9im+6YVvrrI6cKxiAigpG9j++6KFk2iLv1K JN5jMa5NthyK1+NX/Z43ljh/tAB5VFsb4u+h1AiQgNQKdKmlL40vRDGtZYfl7Tq2TxAP P8rSR7tSirJ9XuCZQ74zHvRgmaplkXR+rtfI55LnRERsAmthgN0K0VpZosjH1oXibhle s+yEhdyS1BimKFgAPwrLUSkMcssWdC/oEuDfDyA/MzKoHNfJY58fQUvLrheBqbkBwk2g R7Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=N9oEUoQ2Jr8MeXmf5N4Wf0oX2nVLlUNuFE+OYU6Elfg=; b=o/cFWDnENopSJU8IL7TrSTP0nHn9u2K3X+Oyd7+Wsa2plikDq3yxn1T8ZXhvnrGh9G Oomhop2mhFpOdCB/4jiGtfTkW9jhpk8aiGOFIpyNuxWmYE7t+3kVi50yN1lFC59YnZCD Ga2USs6I1w1t7guulnA+LMHPJLNgGM1uP0Dn/NWYJtBY9BeaeMe6gIIAKJaP5QXL9DBG zc30uO3xqS7v4GO6XNifwPEIWoLWpVv6fmk46uxzujFc2Z4ol2IBoZ1xc9Z3kowUZWRX PlU1LO0G9XvS8JXKjeko2k3n98a0/BX9USvUJuE2MuJLidvfO9Sne4SBn3W/7oRy4Zn1 lgBQ== ARC-Authentication-Results: i=1; mx.google.com; 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 v2-v6si14619752pgt.228.2018.07.16.04.31.19; Mon, 16 Jul 2018 04:31:19 -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; 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 S1731591AbeGPL6Q (ORCPT + 31 others); Mon, 16 Jul 2018 07:58:16 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57878 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728588AbeGPL6P (ORCPT ); Mon, 16 Jul 2018 07:58:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC6D815AD; Mon, 16 Jul 2018 04:31:15 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CC4493F589; Mon, 16 Jul 2018 04:31:12 -0700 (PDT) From: Mark Rutland To: mingo@kernel.org, mingo@redhat.com Cc: andy.shevchenko@gmail.com, arnd@arndb.de, aryabinin@virtuozzo.com, boqun.feng@gmail.com, catalin.marinas@arm.com, dvyukov@google.com, glider@google.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, parri.andrea@gmail.com, peter@hurleysoftware.com, peterz@infradead.org, tglx@linutronix.de, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCHv4 11/12] atomics: check generated headers are up-to-date Date: Mon, 16 Jul 2018 12:30:16 +0100 Message-Id: <20180716113017.3909-12-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180716113017.3909-1-mark.rutland@arm.com> References: <20180716113017.3909-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all the generated atomic headers are in place, it would be good to ensure that: a) the headers are up-to-date when scripting changes. b) developers don't directly modify the generated headers. To ensure both of these properties, let's add a Kbuild step to check that the generated headers are up-to-date. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Ingo Molnar Cc: Peter Zijlstra (Intel) Cc: Will Deacon --- Kbuild | 18 ++++++++++++++++-- scripts/atomic/check-atomics.sh | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100755 scripts/atomic/check-atomics.sh -- 2.11.0 diff --git a/Kbuild b/Kbuild index 005304205482..47c9fe175bd9 100644 --- a/Kbuild +++ b/Kbuild @@ -6,7 +6,8 @@ # 2) Generate timeconst.h # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) # 4) Check for missing system calls -# 5) Generate constants.py (may need bounds.h) +# 5) check atomics headers are up-to-date +# 6) Generate constants.py (may need bounds.h) ##### # 1) Generate bounds.h @@ -72,7 +73,20 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE $(call cmd,syscalls) ##### -# 5) Generate constants for Python GDB integration +# 5) Check atomic headers are up-to-date +# + +always += old-atomics +targets += old-atomics + +quiet_cmd_atomics = CALL $< + cmd_atomics = $(CONFIG_SHELL) scripts/atomic/check-atomics.sh + +old-atomics: scripts/atomic/check-atomics.sh FORCE + $(call cmd,atomics) + +##### +# 6) Generate constants for Python GDB integration # extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh new file mode 100755 index 000000000000..c30101cddf2d --- /dev/null +++ b/scripts/atomic/check-atomics.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Check if atomic headers are up-to-date + +ATOMICDIR=$(dirname $0) +ATOMICTBL=${ATOMICDIR}/atomics.tbl +LINUXDIR=${ATOMICDIR}/../.. + +cat < /dev/null); then + printf "warning: include/${header} is out-of-date.\n" + fi +done