Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7701874rwr; Wed, 10 May 2023 11:20:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7K1wSTZj2YjfmN2jqPmNDvTH0SrSuaFa7IGPOMG4m1Frq54MT6ikDNv9itIqx6v/V0mtIx X-Received: by 2002:a17:902:c3d1:b0:1a9:581e:d809 with SMTP id j17-20020a170902c3d100b001a9581ed809mr18626794plj.7.1683742819844; Wed, 10 May 2023 11:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742819; cv=none; d=google.com; s=arc-20160816; b=Q5Pa07HF47K1sSSkZXsA8s442w2IOo/dX/SpORPcNKjY6BjHd9r/wfWH+SsLdhF/h/ ObYowZq5aaAk5+V7SJjePZ4/9jj0GPzwHl6MxfjCuSbFPZWzwVu+9ONOTbPtvINhJ3e+ bmm2Z9JP5daWcfukXTDU9MwMnI/XWqOmECl+73J0+hy/nab4pByyjnkGEdeZSx8q7J6K Y10G6I4p+on93FjJilUU7M3entJozd/9BWU9GROHGe8fP4wP2zCcKibDw3xqaRwmi50u XvAQH/SyKhMhFwJ1rFhI6qas+KE73eFJnfoqhwVL34SFER0RZHv8AreOjo9q7ele/FVx O9WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O/7ZpNtwcFKLHmXgB4vUQ9B7dXsN3EzGuM0tGUcYnGs=; b=rG6PfIz0DZ9d3W3rS5m1RtrG+ROt7/wbEPRK77la2BGV4bUcPYef5TZKi+gCgDjqbm YDO1lRc8eqvfAFRcG+wQS1QZi2Vojk/ab0kTtExvpfAYQ3kzNeXPL2E4o2ygZCE55RgI +07rar+Y/WoUQ1uPnmr1drxHpgCpwQym08/5gLMai8iCQlN0/qwBYCEirCxUrbnLAqA3 KdLrbfCUAMzYD6ZzvYesRVnvMN33+3PPIObE+Dco16B+RLM1+ZrB1Cvq09KKXkrOzZaz R2SLh4+x8SRurqLW4Uryr9QU1dVslojXdLBALNGhnubUqTNqjb5pgwo60aS9AEcWnU5S x1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Em+tJutP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jk7-20020a170903330700b001aaebc66877si4448529plb.147.2023.05.10.11.20.05; Wed, 10 May 2023 11:20:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Em+tJutP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236300AbjEJSSf (ORCPT + 99 others); Wed, 10 May 2023 14:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236057AbjEJSSP (ORCPT ); Wed, 10 May 2023 14:18:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6EA07DBD; Wed, 10 May 2023 11:18:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 383C563F89; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B34C433EF; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=5orfwLg08dIm14Vms6sjyzzLD3V/C5KXtMlKMkWcY24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Em+tJutPuctz8SiLrvZzic/5pGf+w4amVFJR944sz9bai88jhwKqi+nkCtPNnUE4n gvJ7WNeAmDAecOWnnm9LAhq1pOA7s5sF+Aj1HfAG2b7ec6xio+WcM5tEVk6D9eVBAJ xaDu4viqi/AhOtY/Y7OAhfY+lsgFYFsk4Y19MQg8wh57lYQGCpXlpddJjK3q2TzDhj pOYVPPG5/nJgGCaZPksnNeYZYE4+Ek7oPmPbBmBtpy7wtFkFjLB09x1gJce76W7rpR qqFOumnKGEA+Fxy9CHm41NYF0K4a1/CpYljDtxu7CiuY4N2f/Cj6qJe7UvpYm69xX0 yGHqD5hGTjgrA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E8047CE1D7A; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 10/19] locking/atomic: Add kernel-doc header for arch_${atomic}_inc_unless_negative Date: Wed, 10 May 2023 11:17:08 -0700 Message-Id: <20230510181717.2200934-10-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add kernel-doc header template for arch_${atomic}_inc_unless_negative function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 18 +++++++++++++++++- scripts/atomic/fallbacks/inc_unless_negative | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index e6c7356d5dfc..a90ee496bb81 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1609,6 +1609,14 @@ arch_atomic_inc_not_zero(atomic_t *v) #endif #ifndef arch_atomic_inc_unless_negative +/** + * arch_atomic_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic_inc_unless_negative(atomic_t *v) { @@ -3049,6 +3057,14 @@ arch_atomic64_inc_not_zero(atomic64_t *v) #endif #ifndef arch_atomic64_inc_unless_negative +/** + * arch_atomic64_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic64_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic64_inc_unless_negative(atomic64_t *v) { @@ -3116,4 +3132,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 225b2fe3eb6bbe34729abed7a856b91abc8d434e +// 3fd0ec685588b84c6428145b7628f79ce23a464c diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative index 95d8ce48233f..98830b0dcdb1 100755 --- a/scripts/atomic/fallbacks/inc_unless_negative +++ b/scripts/atomic/fallbacks/inc_unless_negative @@ -1,4 +1,12 @@ cat <