Skip to content

Commit

Permalink
fix(virtio/pci): take slice instead of vec in read_caps
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
  • Loading branch information
mkroening committed Jun 4, 2024
1 parent 4f7b11e commit 3db35b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/virtio/transport/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ fn read_cap_raw(device: &PciDevice<PciConfigRegion>, register: u32) -> PciCapRaw
/// structures inside the memory areas, indicated by the BaseAddressRegisters (BAR's).
fn read_caps(
device: &PciDevice<PciConfigRegion>,
bars: Vec<PciBar>,
bars: &[PciBar],
) -> Result<Vec<PciCap>, PciError> {
let device_id = device.device_id();
let ptr: u32 = dev_caps_ptr(device);
Expand Down Expand Up @@ -1073,7 +1073,7 @@ pub(crate) fn map_caps(device: &PciDevice<PciConfigRegion>) -> Result<UniCapsCol
};

// Get list of PciCaps pointing to capabilities
let cap_list = match read_caps(device, bar_list) {
let cap_list = match read_caps(device, &bar_list) {
Ok(list) => list,
Err(pci_error) => return Err(pci_error),
};
Expand Down

0 comments on commit 3db35b1

Please sign in to comment.