]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: num: make Bounded::get const
authorAlexandre Courbot <acourbot@nvidia.com>
Sat, 14 Mar 2026 01:06:14 +0000 (10:06 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 17 Mar 2026 19:04:11 +0000 (20:04 +0100)
commit7836ec76ec5cd8d45759a6a360b1fda4829d2734
treec87b6b5e17a19d5ce6979ec8fafcfa308576103f
parent164f8634bfd8eef7b90c429156c59706635cfb88
rust: num: make Bounded::get const

There is a need to access the inner value of a `Bounded` in const
context, notably for bitfields and registers. Remove the invariant check
of `Bounded::get`, which allows us to make it const.

Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260314-register-v9-4-86805b2f7e9d@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/num/bounded.rs