Skip to content

Commit 2383e95

Browse files
hoshinolinajannau
authored andcommitted
rust: module_param: Disable clippy::undocumented_unsafe_blocks lint
The missing SAFETY comments should be fixed later... Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent e4d1f2e commit 2383e95

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
@@ -172,6 +172,7 @@ impl Node {
172172
false
173173
}
174174
#[cfg(CONFIG_OF)]
175+
// SAFETY: `raw_node` is valid per the type invariant
175176
unsafe {
176177
bindings::of_node_is_root(self.raw_node)
177178
}

0 commit comments

Comments
 (0)