Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4517963pxj; Tue, 25 May 2021 09:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVczIdBVQPQUJx6nvc53Tes2qFkpD02DSdlnRoDfY1LYdFdYVh+9oSwKO4BJLu47lzqDAx X-Received: by 2002:a05:6402:1489:: with SMTP id e9mr33512394edv.8.1621961091218; Tue, 25 May 2021 09:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621961091; cv=none; d=google.com; s=arc-20160816; b=ON3HqLcc/qSuisVJMeiCvFSmitPlGYreMGBMbNhO6VLepouQLsmcBgE+vNgZYnfv5Y ENPEGcIMQn++UXm6Fw0Vy9TYyTyOQOJzMjJD7RnDP/2Kb/8hrSn6KL9SiE78c3yv51h3 7UBTYJapfBtDP1YIignHTtc4g1Bggezb/sO4ng55eeaU/484D1kmNSdMCdh/A4RlD1XD N1B53JKIZzwTz8u8zDuxtSSfVJNTZMbBK9/m3mupWJAD6FeTtW26HWjjvvjryJBugm9s IEyfkjQuiAblQc61TKZeU6smuL+kh5hZt9/Cc8XryIVIPVLE7d3zPhgfhhUnz7gpy37m qrYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=YI8VorBwNEInZldVNixMenHvgNFErLKvBBbxWDdL6NU=; b=Np0nWJS3mJJztoAvOd7nEP0Grvu8R0j8YyLG2sGDZpELHQoiIpkF6Ly+yCPsoHjpup 0nzX6QrZ6J1+Uv3ycAyg4ym53UBny7wsoF0G5GU7Xzc6Spse+68MkY1pAE3ItffNz6I0 VK53DsJE6DWUiAHzLEqEfvZK7jFrCl9jEhu085E2j5wvE3CO//j6Iqqy+BgS7UtTp9oB y4YAobgOXFBeOODxlFVXZ8tUDryQqb3+M0nsOneLNA6G84GEQTSHnXikLJQcGRrM3sGx G5DHUsa0lpSaQlK6s0azJJCHJGgDGqJ7kqgZU9yndoTOoUwrbpLeH55Qs6Ox6Vx51w1o lZ2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si5135666ejk.275.2021.05.25.09.44.27; Tue, 25 May 2021 09:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233571AbhEYOGM (ORCPT + 99 others); Tue, 25 May 2021 10:06:12 -0400 Received: from foss.arm.com ([217.140.110.172]:56928 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbhEYOGL (ORCPT ); Tue, 25 May 2021 10:06:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 766111435; Tue, 25 May 2021 07:04:41 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 317C83F73D; Tue, 25 May 2021 07:04:37 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org, will@kernel.org, boqun.feng@gmail.com, peterz@infradead.org Cc: aou@eecs.berkeley.edu, arnd@arndb.de, bcain@codeaurora.org, benh@kernel.crashing.org, chris@zankel.net, dalias@libc.org, davem@davemloft.net, deanbo422@gmail.com, deller@gmx.de, geert@linux-m68k.org, gerg@linux-m68k.org, green.hu@gmail.com, guoren@kernel.org, ink@jurassic.park.msu.ru, James.Bottomley@HansenPartnership.com, jcmvbkbc@gmail.com, jonas@southpole.se, ley.foon.tan@intel.com, linux@armlinux.org.uk, mark.rutland@arm.com, mattst88@gmail.com, monstr@monstr.eu, mpe@ellerman.id.au, nickhu@andestech.com, palmerdabbelt@google.com, paulus@samba.org, paul.walmsley@sifive.com, rth@twiddle.net, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tsbogend@alpha.franken.de, vgupta@synopsys.com, ysato@users.sourceforge.jp Subject: [PATCH v2 06/33] locking/atomic: atomic: remove stale comments Date: Tue, 25 May 2021 15:02:05 +0100 Message-Id: <20210525140232.53872-7-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210525140232.53872-1-mark.rutland@arm.com> References: <20210525140232.53872-1-mark.rutland@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commentary in asm-generic/atomic.h is stale; let's bring it up-to date: * The block comment at the start of the file mentions this is only usable on UP systems, but is immediately followed by an SMP implementation using cmpxchg. Let's delete the misleading statement. * A comment near the end of the file was originally at the top of the file, but over time rework has shuffled it near the end, and it's long been superceded by the block comment at the top of the file. Let's remove it. * Since asm-generic/atomic.h isn't the canonical documentation for the atomic ops, and since the existing comments are not in kerneldoc format, we don't need to document the semantics of each operation here (and this would be better done in a centralised document). Let's remove these comments. Signed-off-by: Mark Rutland Cc: Arnd Bergmann Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon --- include/asm-generic/atomic.h | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 11f96f40f4a7..ebacbc6b363b 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * Generic C implementation of atomic counter operations. Usable on - * UP systems only. Do not include in machine independent code. + * Generic C implementation of atomic counter operations. Do not include in + * machine independent code. * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) @@ -12,23 +12,6 @@ #include #include -/* - * atomic_$op() - $op integer to atomic variable - * @i: integer value to $op - * @v: pointer to the atomic variable - * - * Atomically $ops @i to @v. Does not strictly guarantee a memory-barrier, use - * smp_mb__{before,after}_atomic(). - */ - -/* - * atomic_$op_return() - $op interer to atomic variable and returns the result - * @i: integer value to $op - * @v: pointer to the atomic variable - * - * Atomically $ops @i to @v. Does imply a full memory barrier. - */ - #ifdef CONFIG_SMP /* we can build all atomic primitives from cmpxchg */ @@ -154,28 +137,10 @@ ATOMIC_OP(xor, ^) #undef ATOMIC_OP_RETURN #undef ATOMIC_OP -/* - * Atomic operations that C can't guarantee us. Useful for - * resource counting etc.. - */ - -/** - * atomic_read - read atomic variable - * @v: pointer of type atomic_t - * - * Atomically reads the value of @v. - */ #ifndef atomic_read #define atomic_read(v) READ_ONCE((v)->counter) #endif -/** - * atomic_set - set atomic variable - * @v: pointer of type atomic_t - * @i: required value - * - * Atomically sets the value of @v to @i. - */ #define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i)) #include -- 2.11.0