mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	linux-clk@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] rust: clk: use the type-state pattern
Date: Wed, 30 Jul 2025 09:27:18 -0300	[thread overview]
Message-ID: <9746F6D6-488C-4562-8FB1-BE268C69BA97@collabora.com> (raw)
In-Reply-To: <20250730062355.bqifrzvxfmaaugnk@vireshk-i7>

Hi Viresh,

> On 30 Jul 2025, at 03:23, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> 
> On 29-07-25, 18:38, Daniel Almeida wrote:
>> diff --git a/rust/kernel/clk.rs b/rust/kernel/clk.rs
>>     /// A reference-counted clock.
>>     ///
>>     /// Rust abstraction for the C [`struct clk`].
>>     ///
>> +    /// A [`Clk`] instance represents a clock that can be in one of several
>> +    /// states: [`Unprepared`], [`Prepared`], or [`Enabled`].
>> +    ///
>> +    /// No action needs to be taken when a [`Clk`] is dropped. The calls to
>> +    /// `clk_unprepare()` and `clk_disable()` will be placed as applicable.
>> +    ///
>> +    /// An optional [`Clk`] is treated just like a regular [`Clk`], but its
>> +    /// inner `struct clk` pointer is `NULL`. This interfaces correctly with the
>> +    /// C API and also exposes all the methods of a regular [`Clk`] to users.
>> +    ///
>>     /// # Invariants
>>     ///
>>     /// A [`Clk`] instance holds either a pointer to a valid [`struct clk`] created by the C
>> @@ -99,20 +160,39 @@ mod common_clk {
>>     /// Instances of this type are reference-counted. Calling [`Clk::get`] ensures that the
>>     /// allocation remains valid for the lifetime of the [`Clk`].
>>     ///
>> -    /// ## Examples
>> +    /// The [`Prepared`] state is associated with a single count of
>> +    /// `clk_prepare()`, and the [`Enabled`] state is associated with a single
>> +    /// count of `clk_enable()`, and the [`Enabled`] state is associated with a
>> +    /// single count of `clk_prepare` and `clk_enable()`.
> 
> You have mentioned the `Enabled` state twice. Also clk_prepare() ?

Ah, thanks for catching that.

What’s the issue with clk_prepare? You mean that the parenthesis are missing?

> 
> No objections from my side. Thanks.
> 
> -- 
> viresh

— Daniel


  reply	other threads:[~2025-07-30 12:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 21:38 Daniel Almeida
2025-07-30  6:23 ` Viresh Kumar
2025-07-30 12:27   ` Daniel Almeida [this message]
2025-07-30 14:48     ` Viresh Kumar
2025-07-30  7:29 ` Daniel Sedlak
2025-07-30  8:20   ` Benno Lossin
2025-07-30 12:59     ` Daniel Almeida
2025-07-30 13:27       ` Daniel Sedlak
2025-07-30 13:30         ` Daniel Almeida
2025-07-30 13:39         ` Alice Ryhl
2025-07-30 13:45           ` Daniel Almeida
2025-07-30  8:29   ` Danilo Krummrich
2025-07-30 12:25   ` Daniel Almeida
2025-07-30  8:03 ` Danilo Krummrich
2025-07-30 12:13   ` Daniel Almeida
2025-07-30 12:24     ` Danilo Krummrich
2025-07-30 13:52 ` Daniel Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9746F6D6-488C-4562-8FB1-BE268C69BA97@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®