Skip to content

Commit

Permalink
bsp: fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
hegza committed Sep 4, 2024
1 parent 10073db commit 344f118
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/headsail-bsp/src/hpc/hart_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ unsafe impl HartIdNumber for HartId {
Err(number)
} else {
// SAFETY: valid context number
Ok(unsafe { core::mem::transmute(number) })
Ok(unsafe { core::mem::transmute::<u16, HartId>(number) })
}
}
}
2 changes: 1 addition & 1 deletion examples/headsail-bsp/src/hpc/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ unsafe impl PriorityNumber for Priority {
Err(number)
} else {
// SAFETY: valid priority number
Ok(unsafe { core::mem::transmute(number) })
Ok(unsafe { core::mem::transmute::<u8, Priority>(number) })
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions examples/headsail-bsp/src/mmap.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Allowed for extra clarity in certain cases
#![allow(clippy::identity_op)]

pub const EXT_ACCESS_BIT: usize = match () {
#[cfg(feature = "hpc")]
() => 1 << 32,
Expand Down
2 changes: 2 additions & 0 deletions examples/headsail-bsp/src/sysctrl/mmap.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Allowed for extra clarity in certain cases
#![allow(clippy::identity_op)]
/// SysCtrl-specific, SysCtrl internal memory maps
pub(crate) const SYSCTRL_ADDR: usize = 0x1a10_0000;
Expand Down
2 changes: 1 addition & 1 deletion examples/headsail-bsp/src/ufmt_panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl uDisplay for PanicInfoWrapper<'_> {
W: crate::ufmt::uWrite + ?Sized,
{
if let Some(msg) = self.0.payload().downcast_ref::<&str>() {
f.write_str(&msg)
f.write_str(msg)
} else {
f.write_str("panic occurred")
}
Expand Down

0 comments on commit 344f118

Please sign in to comment.