Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp548529imm; Wed, 6 Jun 2018 01:58:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIpcKkp+Yejn7P2LUlYVtbovpJXLKD6J1m54fOpanSZk55xUIM3zrJjiC+pETiBhz/BZHVj X-Received: by 2002:a62:418b:: with SMTP id g11-v6mr1603768pfd.51.1528275500038; Wed, 06 Jun 2018 01:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528275500; cv=none; d=google.com; s=arc-20160816; b=tf1OoZoZ0v4Ih00V8z4M5Zp82oUJ6qkPBe6N0qsqLQ6j0hZKt/BfAsvVaonlLmFyuL luIaL04rKwiRKiTQU/YiWQsXJEIzGBS0GUmabUi9m2SYUCBFnMheqZGTXhUWPmAzxe0o OKy99yNDtuDYs8Edkt9sBwPuhnaGrR9IlBiQymEDfLgNGIlQITQCkcKY6IecgMqlOCGm WT+LEcvKv0bcprOvuRyj9AbNyRoPh4eQBTa9Vk+Olz/qBpYppCxXknjg9WGurat7ViFU v7EKfqNkKpcPkqljBFskiKl91jXp1K3umi2JQCGnIDgxMj2MQsSrWc9rnWXLquco0Gw6 jVXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=Ekuat/zsTQ3mIJC0HQCDAsT+b+4SAIgfKjg0nt91Yw8=; b=p3anGoKTTMDveuA/MUbdiXrX68xZnT8z/KATMAoanppkG7fdEjMRq/Mh65ZUXawv7m Iqz6jsqsoesJkRpE4O7zBZXNOr5sGVwsi4qL9fDynPiFPaDmRCfwxQBewtp0OXVZgnje gDdo/zjH6HaZ0PiLpnIjaCkvzikHT6n43d+aOImAM9rQZ65dA3t5WKqqux2ATdMNYZtI b+D0HvD4sApZB1DbbkLqDeIIlUsDUoNRVOPaS8i9mKNmgJL0j4Vu5DUPm/rYxiTjnk90 hRyZqz4ZmTEnNpnmrusUiBGbfPqBhvN1RYqP6PAz4XmWTapUSaDAbaAKK2Nl3lyLvhPk C36A== 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 y34-v6si51214953plb.17.2018.06.06.01.58.05; Wed, 06 Jun 2018 01:58:20 -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 S932294AbeFFI5k (ORCPT + 99 others); Wed, 6 Jun 2018 04:57:40 -0400 Received: from ozlabs.org ([203.11.71.1]:55797 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932217AbeFFI5i (ORCPT ); Wed, 6 Jun 2018 04:57:38 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 4112cb6XLgz9rxs; Wed, 6 Jun 2018 18:57:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Mark Rutland Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Boqun Feng , Will Deacon , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Benjamin Herrenschmidt , Paul Mackerras , Palmer Dabbelt , Albert Ou Subject: Re: [PATCHv2 05/16] atomics: prepare for atomic64_fetch_add_unless() In-Reply-To: <20180605110808.5ms6kbsayj2dbo7z@lakrids.cambridge.arm.com> References: <20180529154346.3168-1-mark.rutland@arm.com> <20180529154346.3168-6-mark.rutland@arm.com> <20180605092637.GF12258@hirez.programming.kicks-ass.net> <20180605095357.64zgw3uq3py2pjs4@lakrids.cambridge.arm.com> <87bmcpo65w.fsf@concordia.ellerman.id.au> <20180605110808.5ms6kbsayj2dbo7z@lakrids.cambridge.arm.com> Date: Wed, 06 Jun 2018 18:57:34 +1000 Message-ID: <87tvqgmgw1.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Rutland writes: > On Tue, Jun 05, 2018 at 08:54:03PM +1000, Michael Ellerman wrote: >> Mark Rutland writes: >> > On Tue, Jun 05, 2018 at 11:26:37AM +0200, Peter Zijlstra wrote: >> >> On Tue, May 29, 2018 at 04:43:35PM +0100, Mark Rutland wrote: >> >> > /** >> >> > + * atomic64_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 non-zero if @v was not @u, and zero otherwise. >> >> >> >> I always get confused by that wording; would something like: "Returns >> >> true if the addition was done" not be more clear? >> > >> > Sounds clearer to me; I just stole the wording from the existing >> > atomic_add_unless(). >> > >> > I guess you'll want similar for the conditional inc/dec ops, e.g. >> > >> > /** >> > * atomic_inc_not_zero - increment unless the number is zero >> > * @v: pointer of type atomic_t >> > * >> > * Atomically increments @v by 1, so long as @v is non-zero. >> > * Returns non-zero if @v was non-zero, and zero otherwise. >> > */ >> >> If we're bike-shedding .. :) >> >> I think "so long as" is overly wordy and not helpful. It'd be clearer >> just as: >> >> * Atomically increments @v by 1, if @v is non-zero. > > I agree; done. Thanks. cheers