Skip to content

Commit 351d94e

Browse files
committed
drm/asahi: fw: Clippy fixes
Signed-off-by: Asahi Lina <[email protected]>
1 parent c90dea8 commit 351d94e

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/asahi/fw/event.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub(crate) mod raw {
5252
impl Default for NotifierState::ver {
5353
fn default() -> Self {
5454
#[allow(unused_mut)]
55+
// SAFETY: All bit patterns are valid for this type.
5556
let mut s: Self = unsafe { core::mem::zeroed() };
5657
#[ver(V >= V13_0B4)]
5758
s.unk_buf = Array::new([0xff; 0x8]);

drivers/gpu/drm/asahi/fw/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub(crate) struct FwStamp(pub(crate) AtomicU32);
5353
#[repr(C, packed(1))]
5454
pub(crate) struct U64(pub(crate) u64);
5555

56+
// SAFETY: U64 is zeroable just like u64
5657
unsafe impl Zeroable for U64 {}
5758

5859
impl fmt::Debug for U64 {
@@ -70,6 +71,7 @@ impl fmt::Debug for U64 {
7071
#[repr(C, packed(1))]
7172
pub(crate) struct U32(pub(crate) u32);
7273

74+
// SAFETY: U32 is zeroable just like u32
7375
unsafe impl Zeroable for U32 {}
7476

7577
impl fmt::Debug for U32 {

0 commit comments

Comments
 (0)