[PATCH v2 1/8] rust: hrtimer: Document the return value for HrTimerHandle::cancel()

Lyude Paul posted 8 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v2 1/8] rust: hrtimer: Document the return value for HrTimerHandle::cancel()
Posted by Lyude Paul 8 months, 1 week ago
Just a drive-by fix I noticed: we don't actually document what the return
value from cancel() does, so do that.

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 rust/kernel/time/hrtimer.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs
index 27243eaaf8ed7..bfe0e25f5abd0 100644
--- a/rust/kernel/time/hrtimer.rs
+++ b/rust/kernel/time/hrtimer.rs
@@ -304,6 +304,8 @@ pub unsafe trait HrTimerHandle {
     /// Note that the timer might be started by a concurrent start operation. If
     /// so, the timer might not be in the **stopped** state when this function
     /// returns.
+    ///
+    /// Returns whether or not the timer was running.
     fn cancel(&mut self) -> bool;
 }
 
-- 
2.48.1
Re: [PATCH v2 1/8] rust: hrtimer: Document the return value for HrTimerHandle::cancel()
Posted by Andreas Hindborg 8 months ago
Lyude Paul <lyude@redhat.com> writes:

> Just a drive-by fix I noticed: we don't actually document what the return
> value from cancel() does, so do that.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
>  rust/kernel/time/hrtimer.rs | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs
> index 27243eaaf8ed7..bfe0e25f5abd0 100644
> --- a/rust/kernel/time/hrtimer.rs
> +++ b/rust/kernel/time/hrtimer.rs
> @@ -304,6 +304,8 @@ pub unsafe trait HrTimerHandle {
>      /// Note that the timer might be started by a concurrent start operation. If
>      /// so, the timer might not be in the **stopped** state when this function
>      /// returns.
> +    ///
> +    /// Returns whether or not the timer was running.

How about:

  Returns true if the timer was running.

?


Best regards,
Andreas Hindborg