[PATCH v3 1/2] rust: math: add div64_u64() and div64_u64_round_up()
FUJITA Tomonori
tomo at flapping.org
Wed Nov 18 14:43:18 PST 2026
On Wed, 18 Nov 2026 21:52:36 +0100
Alice Ryhl <aliceryhl at google.com> wrote:
> On Fri, Oct 30, 2026 at 3:02 AM FUJITA Tomonori <tomo at flapping.org> wrote:
>> +#[inline]
>> +pub fn div64_u64(dividend: u64, divisor: u64) -> u64 {
>
> You're missing #[track_caller] on both functions.
>
>> + if divisor == 0 {
>> + panic!("attempt to divide by zero");
>> + }
>
> I suspect the panic built-in to the / operator may be more efficient,
> so please move this panic inside #[cfg(not(CONFIG_64BIT))].
Thanks, both make sense. I will fix them in v4.
More information about the linux-riscv
mailing list