Skip to content

Commit

Permalink
Bump versions, update rust version, fix warnings, clippies and checks
Browse files Browse the repository at this point in the history
Signed-off-by: Graham MacDonald <[email protected]>
  • Loading branch information
gmacd authored and dancrossnyc committed Jun 11, 2024
1 parent 7b61696 commit 0209f15
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 86 deletions.
166 changes: 90 additions & 76 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aarch64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ default-target = "aarch64-unknown-none"
[dependencies]
bitstruct = "0.1"
port = { path = "../port" }
num_enum = { version = "0.7.0", default-features = false }
num_enum = { version = "0.7", default-features = false }
3 changes: 1 addition & 2 deletions aarch64/src/mailbox.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::io::{read_reg, write_reg};
use crate::param::KZERO;
use core::mem;
use core::mem::MaybeUninit;
use port::fdt::DeviceTree;
use port::mcslock::{Lock, LockNode};
Expand Down Expand Up @@ -121,7 +120,7 @@ where
T: Copy,
U: Copy,
{
let size = mem::size_of::<Message<T, U>>() as u32;
let size = size_of::<Message<T, U>>() as u32;
let req = Request::<Tag<T>> { size, code, tags: *tags };
let mut msg = MessageWithTags { request: req };
let node = LockNode::new();
Expand Down
2 changes: 1 addition & 1 deletion port/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
bitflags = "2.3.3"
bitflags = "2.5"
1 change: 1 addition & 0 deletions port/src/dat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct Chan {
// path: *const Path,
}

#[allow(dead_code)]
pub struct Device {
_dc: u32,
_name: &'static str,
Expand Down
5 changes: 3 additions & 2 deletions port/src/fdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl<'a> DeviceTree<'a> {
/// Create new DeviceTree based on memory pointed to by data.
/// Result is error if the header can't be parsed correctly.
pub fn new(data: &'a [u8]) -> Result<Self> {
let uninit_data = unsafe { core::mem::transmute(data) };
let uninit_data =
unsafe { core::mem::transmute::<&[u8], &[core::mem::MaybeUninit<u8>]>(data) };
FdtHeader::new(uninit_data, false).map(|header| Self { data: uninit_data, header })
}

Expand All @@ -76,7 +77,7 @@ impl<'a> DeviceTree<'a> {

// Extract the real length from the header
let dtb_buf_for_header: &[mem::MaybeUninit<u8>] =
unsafe { core::slice::from_raw_parts(u8ptr, mem::size_of::<FdtHeader>()) };
unsafe { core::slice::from_raw_parts(u8ptr, size_of::<FdtHeader>()) };
let dtb_for_header = FdtHeader::new(dtb_buf_for_header, true)
.map(|header| Self { data: dtb_buf_for_header, header })?;
let len = dtb_for_header.header.totalsize as usize;
Expand Down
6 changes: 6 additions & 0 deletions port/src/mcslock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ impl LockNode {
}
}

impl Default for LockNode {
fn default() -> Self {
Self::new()
}
}

/// An MCS lock.
pub struct MCSLock {
_name: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-06-01"
channel = "nightly-2024-06-08"
components = [ "rustfmt", "rust-src", "clippy", "llvm-tools" ]
targets = [
"aarch64-unknown-none",
Expand Down
6 changes: 3 additions & 3 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.2.4", features = ["derive"] }
serde = { version = "1.0.160", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
target-lexicon = { version = "0.12" }
toml = "0.8.0"
toml = "0.8"

0 comments on commit 0209f15

Please sign in to comment.