[PW_SID:1100485] [RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup#2012
[PW_SID:1100485] [RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup#2012linux-riscv-bot wants to merge 1 commit into
Conversation
The cycle register is always u32, so cycles_to_ns() can take a u32 instead of a u64. With that narrowing, cycles * NSEC_PER_SEC is at most u32::MAX * 1e9 (~4.3e18), which fits in u64 without overflow. The saturating arithmetic is therefore no longer needed, and the ceiling division can use Rust's u64::div_ceil() directly instead of the open-coded numerator/denominator form. This also drops the TODO referring to a future mul_u64_u64_div_u64_roundup kernel helper, which is no longer required. Signed-off-by: Maurice Hieronymus <mhi@mailbox.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
|
Patch 1: "[RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup" |
PR for series 1100485 applied to workflow__riscv__fixes
Name: [RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1100485
Version: 1