Skip to content

rust: switch CondVar's timeout API to Delta

FUJITA Tomonori rust-for-linux 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: time: add jiffies conversion helpers to Deltarust/kernel/time.rs+34 -00 replies
2/2rust: sync: use Delta for CondVar timeout APIdrivers/android/binder/process.rs rust/kernel/sync/condvar.rs+18 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/2] rust: switch CondVar's timeout API to Delta

From: FUJITA Tomonori <[email protected]>

CondVar::wait_interruptible_timeout() currently takes and returns a raw jiffies count (a plain c_ulong alias with no type safety). Callers have to know on their own that the value meant jiffies and convert to/from it themselves, which is easy to get wrong (e.g. passing a millisecond value where a jiffies value is expected).

This series adds jiffies conversion helpers to Delta and then switches CondVar's timeout API to use Delta instead of raw jiffies, updating its only caller, binder's ioctl_freeze().

FUJITA Tomonori (2):
rust: time: add jiffies conversion helpers to Delta
rust: sync: use Delta for CondVar timeout API

 drivers/android/binder/process.rs | 12 +++++------
 rust/kernel/sync/condvar.rs       | 20 ++++++++++--------
 rust/kernel/time.rs               | 34 +++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 14 deletions(-)

base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482

Signature · 1 line
2.43.0