summaryrefslogtreecommitdiff
path: root/rust/kernel/bitmap.rs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-10-15 08:48:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-10-15 08:48:17 -0700
commit5a6f65d1502551f84c158789e5d89299c78907c7 (patch)
tree7fc06e4a65a63a6d4e72236e81083cb22f70856c /rust/kernel/bitmap.rs
parent1f4a222b0e334540343fbb5d3eac4584a6bfe180 (diff)
parent7e85ac9da1acc591bd5269f2b890ed1994c42e96 (diff)
Merge tag 'bitmap-for-v6.18-rc2' of https://github.com/norov/linux
Pull bitmap fixes from Yury Norov: "A "unnecessary `unsafe`" warning fix for bitmap/rust, and one leftover patch for FIELD_PREP_WM16() conversion. - rust: bitmap: clean Rust 1.92.0 `unused_unsafe` warning (Miguel) - FIELD_PREP_WM16() rework leftover (Nicolas)" * tag 'bitmap-for-v6.18-rc2' of https://github.com/norov/linux: PM / devfreq: rockchip-dfi: switch to FIELD_PREP_WM16 macro rust: bitmap: clean Rust 1.92.0 `unused_unsafe` warning
Diffstat (limited to 'rust/kernel/bitmap.rs')
-rw-r--r--rust/kernel/bitmap.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/kernel/bitmap.rs b/rust/kernel/bitmap.rs
index f45915694454..711b8368b38f 100644
--- a/rust/kernel/bitmap.rs
+++ b/rust/kernel/bitmap.rs
@@ -166,6 +166,7 @@ impl core::ops::Deref for BitmapVec {
fn deref(&self) -> &Bitmap {
let ptr = if self.nbits <= BITS_PER_LONG {
// SAFETY: Bitmap is represented inline.
+ #[allow(unused_unsafe, reason = "Safe since Rust 1.92.0")]
unsafe { core::ptr::addr_of!(self.repr.bitmap) }
} else {
// SAFETY: Bitmap is represented as array of `unsigned long`.
@@ -182,6 +183,7 @@ impl core::ops::DerefMut for BitmapVec {
fn deref_mut(&mut self) -> &mut Bitmap {
let ptr = if self.nbits <= BITS_PER_LONG {
// SAFETY: Bitmap is represented inline.
+ #[allow(unused_unsafe, reason = "Safe since Rust 1.92.0")]
unsafe { core::ptr::addr_of_mut!(self.repr.bitmap) }
} else {
// SAFETY: Bitmap is represented as array of `unsigned long`.