Skip to content

Commit 9550ea3

Browse files
committed
refactor(virtqueue/split): make next_wrap a u8
Signed-off-by: Martin Kröning <[email protected]>
1 parent 83c6b23 commit 9550ea3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/drivers/virtio/virtqueue/split.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl DescrRing {
147147
unsafe { VolatileRef::new_read_only(NonNull::new(self.used_ring_cell.get()).unwrap()) }
148148
}
149149

150-
fn push(&mut self, tkn: TransferToken) -> (u16, u16) {
150+
fn push(&mut self, tkn: TransferToken) -> (u16, u8) {
151151
let mut desc_lst = Vec::new();
152152
let mut is_indirect = false;
153153

@@ -381,7 +381,7 @@ impl Virtq for SplitVq {
381381
let index = self.index.0.to_le_bytes();
382382
let mut index = index.iter();
383383
let det_notif_data: u16 = next_off & !(1 << 15);
384-
let flags = (det_notif_data | (next_wrap << 15)).to_le_bytes();
384+
let flags = (det_notif_data | (u16::from(next_wrap) << 15)).to_le_bytes();
385385
let mut flags = flags.iter();
386386
let mut notif_data: [u8; 4] = [0, 0, 0, 0];
387387

0 commit comments

Comments
 (0)