diff options
| author | Georgios Androutsopoulos <georgeandrout13@gmail.com> | 2026-09-08 18:56:15 -0400 |
|---|---|---|
| committer | Brian Masney <bmasney@redhat.com> | 2026-09-23 15:33:44 -0400 |
| commit | 45a68afbd4b632538a0956ba783fca45b8ceb446 (patch) | |
| tree | feb0aece4448a07d1a9eb8df2a745f5c8df63e2d /include/linux/clk | |
| parent | 4e39820b601221997cb2220edc830f92367cdfc2 (diff) | |
rust: clk: document overflow panics in `Hertz` constructors
`Hertz::from_khz()`, `from_mhz()` and `from_ghz()` multiply their
argument by 1_000, 1_000_000 and 1_000_000_000 respectively without
checking for overflow. When `CONFIG_RUST_OVERFLOW_CHECKS` is enabled,
each panics once its argument exceeds `c_ulong::MAX` divided by that
factor. None of the three documents this. The panic occurs only at
runtime, when the argument is not a constant expression.
Add the missing `# Panics` sections stating the bound for each unit.
Fixes: d01d70205601 ("rust: clk: Add initial abstractions")
Signed-off-by: Georgios Androutsopoulos <georgeandrout13@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Diffstat (limited to 'include/linux/clk')
0 files changed, 0 insertions, 0 deletions
