i2c: enable workspace-wide lints

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
Manos Pitsidianakis 2025-08-01 21:18:48 +03:00 committed by Stefano Garzarella
parent 96cda16c85
commit 0915bba494
3 changed files with 7 additions and 3 deletions

View File

@ -31,3 +31,6 @@ vmm-sys-util = "0.14"
assert_matches = "1.5"
virtio-queue = { version = "0.16", features = ["test-utils"] }
vm-memory = { version = "0.16.1", features = ["backend-mmap", "backend-atomic"] }
[lints]
workspace = true

View File

@ -242,7 +242,8 @@ impl SmbusMsg {
// Special Read requests, reqs[0].len can be 0 or 1 only.
Err(Error::MessageLengthInvalid("read", 3))
} else {
data.word = reqs[0].buf[1] as u16 | ((reqs[0].buf[2] as u16) << 8);
data.word =
u16::from(reqs[0].buf[1]) | (u16::from(reqs[0].buf[2]) << 8);
Ok(SmbusMsg {
read_write,
command: reqs[0].buf[0],

View File

@ -407,7 +407,7 @@ mod tests {
vq.desc_table()
.store(index, RawDescriptor::from(desc_out))
.unwrap();
next_addr += desc_out.len() as u64;
next_addr += u64::from(desc_out.len());
index += 1;
// Buf descriptor: optional
@ -430,7 +430,7 @@ mod tests {
vq.desc_table()
.store(index, RawDescriptor::from(desc_buf))
.unwrap();
next_addr += desc_buf.len() as u64;
next_addr += u64::from(desc_buf.len());
index += 1;
}