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

John Snow posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260219185409.708130-1-jsnow@redhat.com
Maintainers: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
rust/hw/core/src/qdev.rs | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
[PATCH v2 0/1] rust: use checked_div()
Posted by John Snow 1 month, 1 week ago
When upgrading from Fedora 41 to Fedora 43 for our CI tests, (Which I do in
https://patchew.org/QEMU/20260216212952.420120-1-jsnow@redhat.com/),
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(-)

-- 
2.53.0

Re: [PATCH v2 0/1] rust: use checked_div()
Posted by Paolo Bonzini 1 month, 1 week ago
Queued, thanks.

Paolo