We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94cebb8 commit 1487237Copy full SHA for 1487237
1 file changed
drivers/gpu/drm/asahi/microseq.rs
@@ -46,6 +46,8 @@ impl Builder {
46
let off = self.ops.len();
47
let p: *const T = &op;
48
let p: *const u8 = p as *const u8;
49
+ // SAFETY: Microseq operations always have no padding bytes, so it is safe to
50
+ // access them as a byte slice.
51
let s: &[u8] = unsafe { core::slice::from_raw_parts(p, core::mem::size_of::<T>()) };
52
self.ops.extend_from_slice(s, GFP_KERNEL)?;
53
Ok(off as i32)
0 commit comments