From patchwork Tue Sep 4 10:48:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 145906 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3506420ljw; Tue, 4 Sep 2018 03:49:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYahiLzIn9EBnAvkNWDctR10MpRtkSHucsNLMvpB/4QjP0HQRUDhhWOY9AfWOTqQwmySF7/ X-Received: by 2002:a63:804a:: with SMTP id j71-v6mr28721567pgd.171.1536058144277; Tue, 04 Sep 2018 03:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536058144; cv=none; d=google.com; s=arc-20160816; b=Ou4YmUc/LK+0LZUZUncixN5twJ5Zgae5jnGuXJRQ1Jkl5si2bhTPD1ng8WReO14n58 G+aLseczYVJemNrNsurGk2J87D5LOKuwJE5qz7bFkcNXdBQOzoy5d4lTq9lUAMVTPc0U tJnkz4WJbZvm7KDGyqzdpGqLRhs/2W00gNmbErKiPUZhFSjQvyicZtiOitPXLyTlU5H4 bMe+kQ3/mb5k3BC8HZlOtYJzljBnfHdIam0sATsRGSshbXF1Dop/NHqlMbFFQilNNN7y +zeuv2I6v8XAbZrkPhH6wcFikAxz46bcTfCoUVtumjD0fHuSFmQKkg/blZQjM/bRFvqn ZlZA== 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=cuMUZ62lHGR7/Y9zmDRzoXRZFODiHE2VsTS7F79tjLx5ovD3fBI1gRQQ3tkrN64E9F +hcxc8Vnazof82R5nqpTJzfDUUNuFIW3hND3j01bmdFWejVEcw+KTfvl/khFP2ZBlJh+ 9Hrxkc96pQxqTwR7GitskC/VdCDG1KydlZvD9qDKoX9XYkW/8XDzCm+N/s7ZGfgVTsih ObOhzoCUh6SHfsJKBuG1YDKIzN9fEEs2mbH8WCLrNS/vFmYb03jZKAEC6uhwy1R9nhBG yaU5z/j6XK1Zfo+pFfvabuPEr8SKg4n2SNXLMkwwRHOgufgT+zxYIbwKVBltcKDkHxNN NHgA== 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 z89-v6si20545163pfd.357.2018.09.04.03.49.03; Tue, 04 Sep 2018 03:49:04 -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 S1727657AbeIDPNe (ORCPT + 32 others); Tue, 4 Sep 2018 11:13:34 -0400 Received: from foss.arm.com ([217.140.101.70]:40378 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727364AbeIDPNe (ORCPT ); Tue, 4 Sep 2018 11:13:34 -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 85B9E7A9; Tue, 4 Sep 2018 03:48:59 -0700 (PDT) Received: from lakrids.Emea.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 503273F5BC; Tue, 4 Sep 2018 03:48:57 -0700 (PDT) From: Mark Rutland To: mingo@kernel.org Cc: arnd@arndb.de, aryabinin@virtuozzo.com, boqun.feng@gmail.com, catalin.marinas@arm.com, dvyukov@google.com, glider@google.com, linuxdrivers@attotech.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, peterz@infradead.org, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCHv3 5/6] atomics: check generated headers are up-to-date Date: Tue, 4 Sep 2018 11:48:29 +0100 Message-Id: <20180904104830.2975-6-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180904104830.2975-1-mark.rutland@arm.com> References: <20180904104830.2975-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