From patchwork Mon Jun 18 10:19:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 138892 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3773769lji; Mon, 18 Jun 2018 03:23:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoeSFZBmcSh0zy7dxMM0sn4aaGDMl5Bp+x/3kCiHU2/lrW4X9qicXRmQ2kDYFnJ1UN7c+5 X-Received: by 2002:a62:9513:: with SMTP id p19-v6mr12854327pfd.239.1529317432357; Mon, 18 Jun 2018 03:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529317432; cv=none; d=google.com; s=arc-20160816; b=MwbxgpBtwNLpxPLQXqgYetPOO9ZgX9gYoUvEHYFnccrBruVdK27SrgchUp0c3s8jl1 LyyD7/R35j1EFK2KZbu+VrEkZN6w2xLl6Wh6huK7iUirb/YW7GzkcCHk8L5ZC+P55Evx iM6bLweiSbH1QBerpRrvmwQezXoP89qASnkqOGsCl/oYUOX/E4zlTGyyxm328VR0f7uY feePrjd5PKvxiZX4hFGzoth32t/j9nyyR8z+UpNwaWr3kBXk7J8EZO2sQmc08LVWKBmO wdZoYXbxr0D4cZ6M2F/quHpT+m4Ej02mHQJEHfFmEJF00HlnWe1Q+56MJsnfjACMZy8n konw== 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=00tXPb/0Sy+kw5oqIyhEh5/2CeJnTHa+7b5afE3k2KY=; b=BOq4KMIQDUqGjBK1LB2ALXfN7xXyiyQEz9ikYwXuf7gTgMmPg1COPqPI2XgdIDlweB 7+TmlwcYha/2jPr15XYrjVQxc6qHoUKQ+kIS8MHIGX/DZ818T9wU4LJ0O4uDAKJMCnvA 2m7fY+GiCcnblQMSt73VtFKd38bUzR2hy8lRIGZNcQqfVx2acBZ50OtCK2Cu7Ah48HXo FNvSLAD3dA5heFrkMTNFWY4778yPwP0PgUQpJ+5jEAZ3ZyHeIX3ElLliT4FCA5dW9ZQt Su52PgAbV6J/FoC10nm7PYPSS0YnZYPlnOH+9RAM+gR2H4lIPGlEPpn2OTuHZPByyeWL 39dA== 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 g79-v6si14477610pfa.271.2018.06.18.03.23.52; Mon, 18 Jun 2018 03:23:52 -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 S937109AbeFRKXu (ORCPT + 30 others); Mon, 18 Jun 2018 06:23:50 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59340 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934189AbeFRKTe (ORCPT ); Mon, 18 Jun 2018 06:19: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 378A715B2; Mon, 18 Jun 2018 03:19:34 -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 064823F25D; Mon, 18 Jun 2018 03:19:32 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org, will.deacon@arm.com, peterz@infradead.org, boqun.feng@gmail.com Cc: mingo@kernel.org, Mark Rutland Subject: [PATCHv3 02/18] atomics/treewide: remove redundant atomic_inc_not_zero() definitions Date: Mon, 18 Jun 2018 11:19:03 +0100 Message-Id: <20180618101919.51973-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180618101919.51973-1-mark.rutland@arm.com> References: <20180618101919.51973-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When 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 Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng 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) {