From patchwork Wed May 23 13:35:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 136652 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp906911lji; Wed, 23 May 2018 06:36:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoVl0lXj6ynF2Fdg6YZ9ChNqK3hNZkZoG+7n3a6NcwB1h5OqoF44p0h2oDsvu61qkTJ0Lsh X-Received: by 2002:a17:902:981:: with SMTP id 1-v6mr3034468pln.11.1527082565946; Wed, 23 May 2018 06:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527082565; cv=none; d=google.com; s=arc-20160816; b=mJT2+goRulyJE/e7FO8C15MACOmO6ecr6AbIcRB8NrEYCSbLDHsU0RlH/Ylz+M1CFt SWrBb4LIU3XjFHYMn1waxgSXndrCmVjJ62EslnKwptlh1F5p7x/0NFsNbJFe9HtBu5nx RO3NwLa+1tkf9J00hz0kmX/9HAoxnIQJYX/R1qWwZ83p/Sas2AsXM16TL4fMaiM9A+wN Z+tmOfpFFSBzW+Amcf82ptu4cLVzD6cgrypV6zbtJzxQdhOSHrkTzHPfc7h92cUvu7RB ZWrJUKEOBWtVc6pr0MP/N2ludX3QCKN+fndlqsRlO/YsXKY4moDJr/wO6Mu07VQ/Us2a qYCQ== 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=3gcAZw6R1lvr3l2WCIQUpQMPA0+TBeYlb0U7Ps/AwkI=; b=N0B91Od/7ot3cVcNw4LFCTvPSb0tqZVEuwsOwDX6esCn0oQ94B9qi2U7Oszo0ImTE4 2zOJ/2cK+OXM6oYel2srFkClzHz26j+8kpIPAZcivnB/sH6jlF9x5DsZzEkwzOHZ01/M hBOsaavjMNQvknIqGAVqZQCYy8C9b/ScBo3nnmtENXJO97DYQa+DPvqMAhpAVAwhgFPs TSJjK2zJaPXfxGLbvdCSqfUqB024HA4FwXgiCwm10jwEO4QbNi+W7szxpJVnQo27uFvD sO39/B3cvTKxGcsdBp9e0J6QaowrsIUVVpa8VVJ0Z6Sytb8EvjWe14xe0qr+AIRi7OPy aN2g== 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 t28-v6si18822470pfi.221.2018.05.23.06.36.05; Wed, 23 May 2018 06:36:05 -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 S933112AbeEWNgD (ORCPT + 30 others); Wed, 23 May 2018 09:36:03 -0400 Received: from foss.arm.com ([217.140.101.70]:55308 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbeEWNf7 (ORCPT ); Wed, 23 May 2018 09:35:59 -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 F16CE80D; Wed, 23 May 2018 06:35:58 -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 E2BC33F24A; Wed, 23 May 2018 06:35:57 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Boqun Feng , Peter Zijlstra , Will Deacon Subject: [PATCH 02/13] atomics/treewide: remove redundant atomic_inc_not_zero() definitions Date: Wed, 23 May 2018 14:35:22 +0100 Message-Id: <20180523133533.1076-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180523133533.1076-1-mark.rutland@arm.com> References: <20180523133533.1076-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vWhen atomic_inc_not_zero(v) isn't defined, will define it as falling back to atomic_add_unless((v), 1, 0), so there's no need for arch code to do so. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon --- arch/arc/include/asm/atomic.h | 2 -- arch/hexagon/include/asm/atomic.h | 2 -- arch/riscv/include/asm/atomic.h | 9 --------- 3 files changed, 13 deletions(-) -- 2.11.0 diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h index 67121b5ff3a3..cecdf3403caf 100644 --- a/arch/arc/include/asm/atomic.h +++ b/arch/arc/include/asm/atomic.h @@ -336,8 +336,6 @@ ATOMIC_OPS(xor, ^=, CTOP_INST_AXOR_DI_R2_R2_R3) c; \ }) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_inc(v) atomic_add(1, v) #define atomic_dec(v) atomic_sub(1, v) diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index 287aa9f394f3..d2feeba93c44 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h @@ -197,8 +197,6 @@ static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u) return __oldval; } -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_inc(v) atomic_add(1, (v)) #define atomic_dec(v) atomic_sub(1, (v)) diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h index 739e810c857e..0e27e050ba14 100644 --- a/arch/riscv/include/asm/atomic.h +++ b/arch/riscv/include/asm/atomic.h @@ -375,15 +375,6 @@ static __always_inline int atomic64_add_unless(atomic64_t *v, long a, long u) } #endif -/* - * The extra atomic operations that are constructed from one of the core - * LR/SC-based operations above. - */ -static __always_inline int atomic_inc_not_zero(atomic_t *v) -{ - return atomic_fetch_add_unless(v, 1, 0); -} - #ifndef CONFIG_GENERIC_ATOMIC64 static __always_inline long atomic64_inc_not_zero(atomic64_t *v) {