From patchwork Mon Nov 27 10:38:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 119665 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp55626qgn; Mon, 27 Nov 2017 02:38:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMY4BNnGAclU4imC+78+G1iDVsjexj/SFJBw+1eCO0kg12VxZwG2II7Jl7n9XRc4lVife+qA X-Received: by 10.98.102.219 with SMTP id s88mr36523215pfj.191.1511779120411; Mon, 27 Nov 2017 02:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511779120; cv=none; d=google.com; s=arc-20160816; b=J4t3xYfQR626BWAa1D7u8R4G8nLhbjwdI12eopm+wvVecBzS/uEoshvBVoLVEgiN1A NvE3bwRHSCg6PkCsf6E2ksTOIPBQcgfoGzsFQ2cUnr2Ek8FunE0KyQzHZq3KX5/yd6Ro gRBHA0CKF9P65AVZPKHT2gMo9IJdUZgwWWC8GR8aHv1pgjze9tVAR1Yuw4BS/6SvEJNm aBWLCUCrjDT1pcI5a1BSbSl4jlCWfCxcD6cve5Gdsh7IgEujpzSuQtOXVCCNdxUxQ0ab X/WjSQBz3YuCDcCtUB+VCKj5C5Q36CCeDzS991FVrvTD5tgbO9wWbi/B+N1OyHEV4Ijv srZg== 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=cOcZJYlZifhTu5q3nXfaNXm5fZO64SbILsxElUWFdlM=; b=eofr0JBX7bCtOd2yEp+Twe1mDob5UTe/q/Hh0hr1tgYpc5nqmlVKj6mIc4XGbwJeLl NFYHNGOxLl2SQ6GCca+4zemhBwBwrGF9hfmhfEfJjur3o+w2roWqVDJ9cvFDKRnAjay8 bfb41AIYk3Q9rHAsCRVgxVCczy1zrb/vHMTzxWZ4h26mSUPEYkwiqoaniCJJNBW7EqjL V4FWdGOj029cXSJASieaWN09pb2N2dadv0Sw4iKHVLqdRshy5WU+7rjyyxvUvOu1B75W bJOKL52IW5O287ie17aNk8VBHQTllJSx96wE1G4hKQXnfbpwlMREG8abLYM01H1HpqeF gS9Q== 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 y12si22719157pgq.348.2017.11.27.02.38.40; Mon, 27 Nov 2017 02:38:40 -0800 (PST) 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 S1751951AbdK0Kig (ORCPT + 28 others); Mon, 27 Nov 2017 05:38:36 -0500 Received: from foss.arm.com ([217.140.101.70]:35764 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbdK0Kid (ORCPT ); Mon, 27 Nov 2017 05:38:33 -0500 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 8C5661610; Mon, 27 Nov 2017 02:38:33 -0800 (PST) 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 099B83F246; Mon, 27 Nov 2017 02:38:31 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org, mingo@redhat.com Cc: acme@redhat.com, apw@canonical.com, joe@perches.com, mark.rutland@arm.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org Subject: [PATCH 1/4] perf mmap: Convert ACCESS_ONCE() to READ_ONCE() Date: Mon, 27 Nov 2017 10:38:21 +0000 Message-Id: <20171127103824.36526-2-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171127103824.36526-1-mark.rutland@arm.com> References: <20171127103824.36526-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently there was a treewide conversion of ACCESS_ONCE() to {READ,WRITE}_ONCE(), but a new use was introduced concurrently by commit: 1695849735752d2a ("perf mmap: Move perf_mmap and methods to separate mmap.[ch] files") Let's convert this over to READ_ONCE() so that we can remove the ACCESS_ONCE() definitions in subsequent patches. Signed-off-by: Mark Rutland Reviewed-by: Paul E. McKenney Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Joe Perches Cc: Peter Zijlstra --- tools/perf/util/mmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index efd78b827b05..3a5cb5a6e94a 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h @@ -70,7 +70,7 @@ void perf_mmap__read_catchup(struct perf_mmap *md); static inline u64 perf_mmap__read_head(struct perf_mmap *mm) { struct perf_event_mmap_page *pc = mm->base; - u64 head = ACCESS_ONCE(pc->data_head); + u64 head = READ_ONCE(pc->data_head); rmb(); return head; } From patchwork Mon Nov 27 10:38:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 119668 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp56187qgn; Mon, 27 Nov 2017 02:39:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMalhZPNKq+K5eU3H0qMfOdJ/xgK82FLa2cqTJ3px5L5RayfOg4Hh1bfyaU7RztZS0Rv/YS2 X-Received: by 10.84.128.229 with SMTP id a92mr22806877pla.108.1511779151620; Mon, 27 Nov 2017 02:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511779151; cv=none; d=google.com; s=arc-20160816; b=iYEyArjPewnaxa8F2E+rb1krrv9U7lAB01Hv0KIA0PpAFibOofwVGq551c0i7r3B8Y HAGxWnQxCKfd63zJYeobkrhFrMN1VMeiVWoyFALhg3J5y1PTDebbJA+msmVKk0E4H7O/ yMZd4Pg+MGzvAd8UBvizhUnJ/v3dymAE6nBP7Jpy2LQdDVRAwhEJKMHH8evzx3SOqnou EhHJITt5vt86wCk8jzfok9B+bI2oIYXUtXjB3cU/+FSnaalyO+yqdBbf+Ogg1IOk8ghl ciqa0o4DDvSp/TDl2tQkFHt4l0NNvpuSyZcQ+5/byCdhm7hm8a3tnKZJRWQFEYLZm9dt 5UiA== 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=feyRSg8P5UI0n2FolzvWjI0ZCln3scQIbAG2XzUuj3c=; b=EU3qCiM6QC1RdJnXghkwl+BWP3P0sW7R+CPh+ECyIIhw4D0ZqJ83T0fyke21rTcegf 3GQFgmNH8ZNgdQ+jxTa/MYc9z16W7OVuAz2L2ZQyfWofcxsffc7JfmJr6SK0aXEPAIzH PQ4oFINSh9jFYKvAG2mueL9PP/eGxh9S4ht/iQP0M3U7mz5rePr1oZwv5ht1DOxaN2k6 wVQHcJ+msYXXpXyI6xWCwvOoa5rYnY8aP7UQji64tsBUCXeEZD1/nFqui4vm0duvTr8l JBa5E+ctUJx9dHtJg+fTujqJ+EixK5BkS+DWdsyzEkc5D2uN4HyHLCEYn+t+QaMe7fDh G42g== 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 y192si22458009pgd.109.2017.11.27.02.39.11; Mon, 27 Nov 2017 02:39:11 -0800 (PST) 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 S1751953AbdK0KjK (ORCPT + 28 others); Mon, 27 Nov 2017 05:39:10 -0500 Received: from foss.arm.com ([217.140.101.70]:35774 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbdK0Kig (ORCPT ); Mon, 27 Nov 2017 05:38:36 -0500 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 B98021596; Mon, 27 Nov 2017 02:38:35 -0800 (PST) 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 404823F246; Mon, 27 Nov 2017 02:38:34 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org, mingo@redhat.com Cc: acme@redhat.com, apw@canonical.com, joe@perches.com, mark.rutland@arm.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org Subject: [PATCH 2/4] tools: include: remove ACCESS_ONCE() Date: Mon, 27 Nov 2017 10:38:22 +0000 Message-Id: <20171127103824.36526-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171127103824.36526-1-mark.rutland@arm.com> References: <20171127103824.36526-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no longer any usersapce uses of ACCESS_ONCE(), so we can remove the definition from our userspace , which is only used by tools in the kernel directory (i.e. it isn't a uapi header). This patch removes the ACCESS_ONCE() definition, and updates comments which referred to it. At the same time, some inconsistent and redundant whitespace is removed from comments. Signed-off-by: Mark Rutland Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Joe Perches Cc: Paul E. McKenney Cc: Peter Zijlstra --- tools/include/linux/compiler.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) -- 2.11.0 diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h index 07fd03c74a77..04e32f965ad7 100644 --- a/tools/include/linux/compiler.h +++ b/tools/include/linux/compiler.h @@ -84,8 +84,6 @@ #define uninitialized_var(x) x = *(&(x)) -#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) - #include /* @@ -135,20 +133,19 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s /* * Prevent the compiler from merging or refetching reads or writes. The * compiler is also forbidden from reordering successive instances of - * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the - * compiler is aware of some particular ordering. One way to make the - * compiler aware of ordering is to put the two invocations of READ_ONCE, - * WRITE_ONCE or ACCESS_ONCE() in different C statements. + * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some + * particular ordering. One way to make the compiler aware of ordering is to + * put the two invocations of READ_ONCE or WRITE_ONCE in different C + * statements. * - * In contrast to ACCESS_ONCE these two macros will also work on aggregate - * data types like structs or unions. If the size of the accessed data - * type exceeds the word size of the machine (e.g., 32 bits or 64 bits) - * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a - * compile-time warning. + * These two macros will also work on aggregate data types like structs or + * unions. If the size of the accessed data type exceeds the word size of + * the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will + * fall back to memcpy and print a compile-time warning. * * Their two major use cases are: (1) Mediating communication between * process-level code and irq/NMI handlers, all running on the same CPU, - * and (2) Ensuring that the compiler does not fold, spindle, or otherwise + * and (2) Ensuring that the compiler does not fold, spindle, or otherwise * mutilate accesses that either do not require ordering or that interact * with an explicit memory barrier or atomic instruction that provides the * required ordering. From patchwork Mon Nov 27 10:38:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 119666 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp55702qgn; Mon, 27 Nov 2017 02:38:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMa5VM4eSp5oFn+Tfx5bY9uzcBeWq4oD2Wo4jxN2LuL2NF8nmMnnP0cOQdEkR0Rdd7in2+21 X-Received: by 10.84.174.4 with SMTP id q4mr3403394plb.207.1511779126134; Mon, 27 Nov 2017 02:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511779126; cv=none; d=google.com; s=arc-20160816; b=YAxsteWgu179/lDhjmNXo/gjt3iR4xOYqcKNj9EVVQI99P5QrWYZxJyKOiO59fyv4r PNS6YnPGgVRJbtJvr48VQcTVtdcdCpodnmQAefWGrYzvIWRe6ojAjpZfplnz4Iow064B I1+oHL7e00fIfQdYBc6z0dkobAe5IlKPRTJ9AJ5xAQXKXQP8q8EwXepbwBMvLgmeJFAY x394JCeCjtFqqWLqofahMhzRkRqVbtrSinLUSiwlDpwZEP2GYdvO5+1ukZ1+fpMPH1gK ccLB7avLjuJDwA/sH4JFEKhjnTG46usdjR65XF6hH9sM7RWV0qopxJyk5BaY/Bfw/79x GrKQ== 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=GGQBzAfqTcP3WwkFsdrOZ6f8XBo9P8PpG/GacMXu0Q8=; b=YjBkkUQ0GtX/Ip7kVmgAmhPB8l5rZ0tZ+7+YFk2OTfVdeBsxuUosSJQRpmukClES55 q/nrZNO+MhV6nN+rItSbzfQc3apkPXa94947ZkXguGqzkImBUbpPDVja09Z8FcVJGxgM Vuk/zTZFcV3L+KexfiFjL7jYQY+ewDxN34Runr9wdWbK32QqIY9AwecagGUUFWNgO0JB TuQjWOeXHeToCMRlCL+3jnYpaW3Amu5tXjYDTibJ6S1zPxidgcpJ6dMLdmtM20Gz7/67 OYQKU+JjqYrjyflliaOAhwO+rJVnQ9Wmp0tSMjJWL+802R2HpFSKAoaHiVqfwxkmxsBR wfLA== 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 o4si22319572pgf.8.2017.11.27.02.38.45; Mon, 27 Nov 2017 02:38:46 -0800 (PST) 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 S1752069AbdK0Kin (ORCPT + 28 others); Mon, 27 Nov 2017 05:38:43 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35790 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbdK0Kii (ORCPT ); Mon, 27 Nov 2017 05:38:38 -0500 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 D0C3C164F; Mon, 27 Nov 2017 02:38:37 -0800 (PST) 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 57B453F246; Mon, 27 Nov 2017 02:38:36 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org, mingo@redhat.com Cc: acme@redhat.com, apw@canonical.com, joe@perches.com, mark.rutland@arm.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org Subject: [PATCH 3/4] compiler.h: remove ACCESS_ONCE() Date: Mon, 27 Nov 2017 10:38:23 +0000 Message-Id: <20171127103824.36526-4-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171127103824.36526-1-mark.rutland@arm.com> References: <20171127103824.36526-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no longer any kernelspace uses of ACCESS_ONCE(), so we can remove the definition from . This patch removes the ACCESS_ONCE() definition, and updates comments which referred to it. At the same time, some inconsistent and redundant whitespace is removed from comments. Signed-off-by: Mark Rutland Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Joe Perches Cc: Paul E. McKenney Cc: Peter Zijlstra --- include/linux/compiler.h | 47 +++++++++++------------------------------------ 1 file changed, 11 insertions(+), 36 deletions(-) -- 2.11.0 diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 188ed9f65517..52e611ab9a6c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -220,21 +220,21 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s /* * Prevent the compiler from merging or refetching reads or writes. The * compiler is also forbidden from reordering successive instances of - * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the - * compiler is aware of some particular ordering. One way to make the - * compiler aware of ordering is to put the two invocations of READ_ONCE, - * WRITE_ONCE or ACCESS_ONCE() in different C statements. + * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some + * particular ordering. One way to make the compiler aware of ordering is to + * put the two invocations of READ_ONCE or WRITE_ONCE in different C + * statements. * - * In contrast to ACCESS_ONCE these two macros will also work on aggregate - * data types like structs or unions. If the size of the accessed data - * type exceeds the word size of the machine (e.g., 32 bits or 64 bits) - * READ_ONCE() and WRITE_ONCE() will fall back to memcpy(). There's at - * least two memcpy()s: one for the __builtin_memcpy() and then one for - * the macro doing the copy of variable - '__u' allocated on the stack. + * These two macros will also work on aggregate data types like structs or + * unions. If the size of the accessed data type exceeds the word size of + * the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will + * fall back to memcpy(). There's at least two memcpy()s: one for the + * __builtin_memcpy() and then one for the macro doing the copy of variable + * - '__u' allocated on the stack. * * Their two major use cases are: (1) Mediating communication between * process-level code and irq/NMI handlers, all running on the same CPU, - * and (2) Ensuring that the compiler does not fold, spindle, or otherwise + * and (2) Ensuring that the compiler does not fold, spindle, or otherwise * mutilate accesses that either do not require ordering or that interact * with an explicit memory barrier or atomic instruction that provides the * required ordering. @@ -327,29 +327,4 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s compiletime_assert(__native_word(t), \ "Need native word sized stores/loads for atomicity.") -/* - * Prevent the compiler from merging or refetching accesses. The compiler - * is also forbidden from reordering successive instances of ACCESS_ONCE(), - * but only when the compiler is aware of some particular ordering. One way - * to make the compiler aware of ordering is to put the two invocations of - * ACCESS_ONCE() in different C statements. - * - * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE - * on a union member will work as long as the size of the member matches the - * size of the union and the size is smaller than word size. - * - * The major use cases of ACCESS_ONCE used to be (1) Mediating communication - * between process-level code and irq/NMI handlers, all running on the same CPU, - * and (2) Ensuring that the compiler does not fold, spindle, or otherwise - * mutilate accesses that either do not require ordering or that interact - * with an explicit memory barrier or atomic instruction that provides the - * required ordering. - * - * If possible use READ_ONCE()/WRITE_ONCE() instead. - */ -#define __ACCESS_ONCE(x) ({ \ - __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \ - (volatile typeof(x) *)&(x); }) -#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) - #endif /* __LINUX_COMPILER_H */ From patchwork Mon Nov 27 10:38:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 119667 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp55922qgn; Mon, 27 Nov 2017 02:38:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMYzZ+NIwOnuS2TOQq5Oo6uZhnB4eDAAvNrG5eGr7s1VjdBJ7pFk9sa6TZzFGibPNNVm0uSi X-Received: by 10.84.168.193 with SMTP id f59mr35846531plb.251.1511779137529; Mon, 27 Nov 2017 02:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511779137; cv=none; d=google.com; s=arc-20160816; b=rSHoaJ3VDApfnh9IeOu2Gocl/Edc/TAP01COuw3iSxWiZTMX1zGNAix3NYQxLDKd6X BRpcrLGOkA1L26LCEG/WzY+G45yBR2PAhmpWktWdko+bULpPjPxvYQB8nDRRVcUb9CLv odN+eH4pB7wCwxFrI3RtsMf4OXSYVrnGdl2WKLG8XFR1UdSe/qRgJUQOQm0ZL2O//5nj rOFG89OnS0VqSDyZ/ImJt9/DmCHTcrUzT5a82Y9i8n/RdPEkRIlOcsFkoKNDhrgjIYN3 rA/2x6kOVT9lmkQHozJtTBy9OSV6AwlyIB7i4wYRdNMBZ+MI9tB57w55/vzBnnCsQgew CPIA== 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=JBLUYbJvrzbMvL2u4WslclxEryY3kwugNFIokAAlXoI=; b=RCr4uEBIvb+GZadDoqzQhadubr6Bvv8x53Prwlzev5EWz4XHAonl8EutkKt2jWMHkk Je2nJVWBy8X4RGOBeocH9unp0nx+gIe5X8RBQtSN5/TaNT+729Q/Mu0vGKFmhDVNY1+7 +Euyu4u6Aa/tlVLYWbYcT6YD5ome+F+PHjZbdnueO3u36UjeZ3O/mYHQ9clSLKJ5Gvl0 e6aVTl3XRFV5FdLYkkUCoyflgxGZ1Td12pcA+YAeVJJOr9BMwwBZAOC9TasYl5VxvoYd agTcTXWBm2xdG5AkmS/9yoLB3Di4i2Rd6K5/dJ5E9unjmgQmT+cxyHcBNfeTtntT0q14 mIwA== 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 j21si22835555pga.622.2017.11.27.02.38.57; Mon, 27 Nov 2017 02:38:57 -0800 (PST) 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 S1752036AbdK0Kim (ORCPT + 28 others); Mon, 27 Nov 2017 05:38:42 -0500 Received: from foss.arm.com ([217.140.101.70]:35810 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751773AbdK0Kik (ORCPT ); Mon, 27 Nov 2017 05:38:40 -0500 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 1F7AB1650; Mon, 27 Nov 2017 02:38:40 -0800 (PST) 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 9A2133F246; Mon, 27 Nov 2017 02:38:38 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org, mingo@redhat.com Cc: acme@redhat.com, apw@canonical.com, joe@perches.com, mark.rutland@arm.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org Subject: [PATCH 4/4] checkpatch: remove ACCESS_ONCE() warning Date: Mon, 27 Nov 2017 10:38:24 +0000 Message-Id: <20171127103824.36526-5-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171127103824.36526-1-mark.rutland@arm.com> References: <20171127103824.36526-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 ACCESS_ONCE() has been excised from the kernel, any uses will result in a build error, and we no longer need to whine about it in checkpatch. This patch removes the newly redundant warning. Signed-off-by: Mark Rutland Cc: Andy Whitcroft Cc: Ingo Molnar Cc: Joe Perches Cc: Paul E. McKenney Cc: Peter Zijlstra --- scripts/checkpatch.pl | 22 ---------------------- 1 file changed, 22 deletions(-) -- 2.11.0 Acked-by: Joe Perches diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 95cda3ecc66b..95c08493b78b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6233,28 +6233,6 @@ sub process { } } -# whine about ACCESS_ONCE - if ($^V && $^V ge 5.10.0 && - $line =~ /\bACCESS_ONCE\s*$balanced_parens\s*(=(?!=))?\s*($FuncArg)?/) { - my $par = $1; - my $eq = $2; - my $fun = $3; - $par =~ s/^\(\s*(.*)\s*\)$/$1/; - if (defined($eq)) { - if (WARN("PREFER_WRITE_ONCE", - "Prefer WRITE_ONCE(, ) over ACCESS_ONCE() = \n" . $herecurr) && - $fix) { - $fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)\s*$eq\s*\Q$fun\E/WRITE_ONCE($par, $fun)/; - } - } else { - if (WARN("PREFER_READ_ONCE", - "Prefer READ_ONCE() over ACCESS_ONCE()\n" . $herecurr) && - $fix) { - $fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)/READ_ONCE($par)/; - } - } - } - # check for mutex_trylock_recursive usage if ($line =~ /mutex_trylock_recursive/) { ERROR("LOCKING",