From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF8F91B4247; Mon, 18 Aug 2025 22:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755557369; cv=none; b=uKX8smAZwpfdzgUL5l3fU9CtLxCmafEYPGhiUxpAOqHDG6XsJ/2k5YpWLqiITy+woNVG41EPtcjtwKOuoskvrzo09gahM+zuQMJZItXk/BUeL2gth1Mekhp+tRCpsG/JqFgH6Z5JJqCwfBt2Nnlht1j60QDZfJFzT12//Wc6IIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755557369; c=relaxed/simple; bh=e8raUYSx+kB5duYi2EeS2q/qnA85lKxEqn2nshSlYrs=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=Xy4AO//IZm1vj/kRpBAFr4CbqOTP6VC4mjE9p4284LKSQxW1sM4J/+1Mzkrf8sTyjC9AKZTRyXBOlwoBjpxcqoHdGkVPe1j5zY8wtg7HWmwZZ5L24fmGRNhRfigRg1+Gvlb3NeSq3evfI2bse2FQUY/JxPdvkuNqGtyIWRslCw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kVHeeeAt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kVHeeeAt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCEC1C4CEEB; Mon, 18 Aug 2025 22:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755557368; bh=e8raUYSx+kB5duYi2EeS2q/qnA85lKxEqn2nshSlYrs=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=kVHeeeAtKZTMPzraDJRX8+GreH31xIDktiuKOIY+U6VzjLxjw7jQHtCZI4C/8YEyk 3PlBVC0jcUzIm0BJdmYHjhZROeq9wYH2qf832/pqjyDg/VdOqxLpncoeCAuPxXPA4L DmLNLp37EnKwcxGr1lkg14cGnJGUOxgT3Kt5IVYyh3h7y5VBBKbryWG7rB827fT9iQ RufMvrNznuNqoI8kB4nsc5gv/+WNHLbC4jPJ9kpvjRL0N1iNiJIePhmzViMWIkFzri sXgkzbjnZ2aLlH7qLRmzJnLNvvNTqddHrhfbsh1rqz714Wco60qxaSTEH/86Sh/hgn gDrQ3wCAzMChw== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 19 Aug 2025 00:49:22 +0200 Message-Id: Cc: , , , , "Miguel Ojeda" , "Alex Gaynor" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Will Deacon" , "Peter Zijlstra" , "Mark Rutland" , "Wedson Almeida Filho" , "Viresh Kumar" , "Lyude Paul" , "Ingo Molnar" , "Mitchell Levy" , "Paul E. McKenney" , "Greg Kroah-Hartman" , "Linus Torvalds" , "Thomas Gleixner" , "Alan Stern" Subject: Re: [PATCH v8 6/9] rust: sync: atomic: Add the framework of arithmetic operations From: "Benno Lossin" To: "Boqun Feng" X-Mailer: aerc 0.20.1 References: <20250719030827.61357-1-boqun.feng@gmail.com> <20250719030827.61357-7-boqun.feng@gmail.com> In-Reply-To: On Sun Aug 17, 2025 at 5:04 AM CEST, Boqun Feng wrote: > On Sat, Aug 16, 2025 at 09:35:26PM +0200, Benno Lossin wrote: >> On Sat Aug 16, 2025 at 6:10 PM CEST, Boqun Feng wrote: >> > On Tue, Aug 12, 2025 at 10:04:12AM +0200, Benno Lossin wrote: >> >> On Sat Jul 19, 2025 at 5:08 AM CEST, Boqun Feng wrote: >> >> > +/// Types that support atomic add operations. >> >> > +/// >> >> > +/// # Safety >> >> > +/// >> >> > +/// `wrapping_add` any value of type `Self::Repr::Delta` obtained = by [`Self::rhs_into_delta()`] to >> >>=20 >> >> Can you add a normal comment TODO here: >> >>=20 >> >> // TODO: properly define `wrapping_add` in this context. >> > >> > Yeah, this sounds good to me. How do you propose we arrange the normal >> > comment with the doc comment, somthing like: >> > >> > // TODO: properly define `wrapping_add` in this context. >> > =20 >> > /// Types that support atomic add operations. >> > /// >> > /// # Safety >> > /// >> > /// `wrapping_add` any value of type `Self::Repr::Delta` obtained = by [`Self::rhs_into_delta()`] to >> > ... >> > pub unsafe trait AtomicAdd<...> { >> > ... >> > } >>=20 >>=20 >> Inline maybe? >>=20 >> /// Types that support atomic add operations. >> /// >> /// # Safety >> /// >> // TODO: properly define `wrapping_add` in this context: > > The colon looks a bit weird to me. I would replace that with a period, > i.e. > > // TODO: properly define `wrapping_add` in the following comment. > /// `wrapping_add` any value of type `Self::Repr::Delta` obtained by= [`Self::rhs_into_delta()`] to > > Thoughts? Also works for me :) --- Cheers, Benno