Skip to content

Commit feb20cf

Browse files
Address review comments
1 parent f82aef7 commit feb20cf

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

rust/kernel/pages.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<const ORDER: u32> Pages<ORDER> {
127127
// so `offset` can't overflow an `isize`.
128128
let dest = unsafe { (mapping.ptr as *mut u8).add(offset) };
129129
// SAFETY: `src` is guaranteed by the caller to be valid for reads, and `dest` is
130-
//valid for writes from the type invariants. Because we're copying `u8`s
130+
// valid for writes from the type invariants. Because we're copying `u8`s
131131
// which have an alignment of 1, `src` and `dest` are always properly aligned.
132132
unsafe { ptr::copy(src, dest, len) };
133133
Ok(())

rust/kernel/print.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ pub unsafe fn call_printk(
138138
args: fmt::Arguments<'_>,
139139
) {
140140
// `_printk` does not seem to fail in any path.
141-
// SAFETY: references are guaranteed to be valid for reads.
142-
// The caller guarantees that `format_string` is a valid format
143-
// specifier and that `module_name` is null-terminated.
141+
// SAFETY: this is safe by the safety contract.
144142
unsafe {
145143
bindings::_printk(
146144
format_string.as_ptr() as _,

0 commit comments

Comments
 (0)