linux/rust
FUJITA Tomonori 880c43b185 rust: time: fix as_micros_ceil() to round correctly for negative Delta
The ceiling-division idiom `(n + d - 1) / d` only produces the
correct result when `n` is non-negative.

For example, if n = -1000 (exactly -1us), the old code computed (-1000
+ 999) / 1000 == 0 instead of -1.

For negative n, truncating division already rounds towards positive
infinity, so no bias is needed in that case.

Fixes: fae0cdc123 ("rust: time: Introduce Delta type")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260713225235.3243480-1-tomo@flapping.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-07-18 19:07:35 +02:00
..
bindings rust: allow suspicious_runtime_symbol_definitions lint for Rust >= 1.98 2026-06-29 13:02:15 +02:00
helpers mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
kernel rust: time: fix as_micros_ceil() to round correctly for negative Delta 2026-07-18 19:07:35 +02:00
macros rust: types: add ForLt trait for higher-ranked lifetime support 2026-05-27 16:24:59 +02:00
pin-init rust: pin_init: internal: use loop {} to produce never value 2026-05-29 21:58:36 +01:00
proc-macro2 rust: proc-macro2: rebuild if the version text changes 2026-01-23 10:44:27 +01:00
quote
syn
uapi rust: allow suspicious_runtime_symbol_definitions lint for Rust >= 1.98 2026-06-29 13:02:15 +02:00
zerocopy rust: zerocopy: update to v0.8.54 2026-07-11 13:46:02 +02:00
zerocopy-derive rust: zerocopy: update to v0.8.54 2026-07-11 13:46:02 +02:00
.gitignore
.kunitconfig
bindgen_parameters rust/bindgen_parameters: Mark s390 types as opaque to prevent repr conflicts 2026-06-10 16:25:13 +02:00
build_error.rs
compiler_builtins.rs
exports.c kbuild: rust: provide an option to inline C helpers into Rust 2026-03-30 02:03:52 +02:00
ffi.rs
Makefile rust: zerocopy: update to v0.8.54 2026-07-11 13:46:02 +02:00