Skip to content

Commit

Permalink
refactor(virtqueue/split): make next_wrap a u8
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Jun 3, 2024
1 parent 83c6b23 commit 9550ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/virtio/virtqueue/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl DescrRing {
unsafe { VolatileRef::new_read_only(NonNull::new(self.used_ring_cell.get()).unwrap()) }
}

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

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

Expand Down

0 comments on commit 9550ea3

Please sign in to comment.