From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296AbdCPQlX (ORCPT ); Thu, 16 Mar 2017 12:41:23 -0400 Received: from mga03.intel.com ([134.134.136.65]:36469 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755133AbdCPQlW (ORCPT ); Thu, 16 Mar 2017 12:41:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,173,1486454400"; d="scan'208";a="945119244" Date: Thu, 16 Mar 2017 09:41:10 -0700 From: Andi Kleen To: Dmitry Vyukov Cc: 20170315021431.13107-3-andi@firstfloor.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , "linux-mm@kvack.org" , "x86@kernel.org" , LKML Subject: Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error Message-ID: <20170316164110.GK32070@tassilo.jf.intel.com> References: <20170316044704.GA729@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Andi, why did you completely remove __arch_atomic_add_unless() from > the header? Don't we need at least a declaration there? Actually it's there in my git version: I wonder where it disappeared. -/** - * __atomic_add_unless - add unless the number is already a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as @v was not already @u. - * Returns the old value of @v. - */ -static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u) -{ - int c, old; - c = atomic_read(v); - for (;;) { - if (unlikely(c == (u))) - break; - old = atomic_cmpxchg((v), c, c + (a)); - if (likely(old == c)) - break; - c = old; - } - return c; -} +int __atomic_add_unless(atomic_t *v, int a, int u);