Skip to content

Commit 045322f

Browse files
committed
rust: module_param: Disable clippy::undocumented_unsafe_blocks lint
The missing SAFETY comments should be fixed later... Signed-off-by: Asahi Lina <[email protected]>
1 parent 1664d1d commit 045322f

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

rust/kernel/io_mem.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,11 @@ impl<const SIZE: usize> IoMem<SIZE> {
163163
}
164164

165165
// Try to map the resource.
166-
// SAFETY: Just mapping the memory range.
167166
let addr = if res.flags & (bindings::IORESOURCE_MEM_NONPOSTED as core::ffi::c_ulong) != 0 {
167+
// SAFETY: Just mapping the memory range.
168168
unsafe { bindings::ioremap_np(res.offset, res.size as _) }
169169
} else {
170+
// SAFETY: Just mapping the memory range.
170171
unsafe { bindings::ioremap(res.offset, res.size as _) }
171172
};
172173

rust/kernel/module_param.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
// FIXME
3+
#![allow(clippy::undocumented_unsafe_blocks)]
24

35
//! Types for module parameters.
46
//!

rust/kernel/of.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ impl Node {
171171
false
172172
}
173173
#[cfg(CONFIG_OF)]
174+
// SAFETY: `raw_node` is valid per the type invariant
174175
unsafe {
175176
bindings::of_node_is_root(self.raw_node)
176177
}

0 commit comments

Comments
 (0)