Skip to content

rust: use checked_div()

John Snow qemu-devel qemu-rust 2 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 3 repliesApplied
  2. v11 patch 3 repliesSuperseded

Changes in v2 from the cover letter

- Fixed divisor/dividend order for period_to_hz; the correct order is DIVIDEND.checked_div(DIVISOR); I had a thinko where I just inverted the formula from period_from_hz(), believing it was a perfect inverse; it isn't! Thank you very much to Richard Henderson for noticing my mistake.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/1rust: use checked_div to make clippy happyrust/hw/core/src/qdev.rs+6 -82 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/1] rust: use checked_div()

When upgrading from Fedora 41 to Fedora 43 for our CI tests, (Which I do in
https://patchew.org/QEMU/[email protected]/),
clippy begins complaining about not using checked_div instead of manually checking divisors; see https://gitlab.com/jsnow/qemu/-/jobs/13169193931

This patch aims to make Clippy happy and prevent any regressions caused by the lcitool refresh.

v2:

- Fixed divisor/dividend order for period_to_hz; the correct order is DIVIDEND.checked_div(DIVISOR); I had a thinko where I just inverted the formula from period_from_hz(), believing it was a perfect inverse; it isn't! Thank you very much to Richard Henderson for noticing my mistake.

John Snow (1):
rust: use checked_div to make clippy happy

 rust/hw/core/src/qdev.rs | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.53.0