nvmed,xhcid: print BAR number

This commit is contained in:
Jeremy Soller
2022-02-11 10:44:38 -07:00
parent 33ef3a3262
commit 544f1cbebc
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -85,7 +85,10 @@ fn get_int_method(
&mut Some(ref bar) => Ok(bar.ptr),
bar_to_set @ &mut None => {
let bar = match function.bars[bir] {
PciBar::Memory(addr) => addr,
PciBar::Memory(addr) => match addr {
0 => panic!("BAR {} is mapped to address 0", bir),
_ => addr,
},
other => panic!("Expected memory BAR, found {:?}", other),
};
let bar_size = function.bar_sizes[bir];
@@ -271,7 +274,7 @@ fn main() {
let bar = match pci_config.func.bars[0] {
PciBar::Memory(mem) => match mem {
0 => panic!("BAR is mapped to address 0"),
0 => panic!("BAR 0 is mapped to address 0"),
_ => mem,
},
other => panic!("received a non-memory BAR ({:?})", other),
+1 -1
View File
@@ -102,7 +102,7 @@ fn main() {
let bar_ptr = match bar {
pcid_interface::PciBar::Memory(ptr) => match ptr {
0 => panic!("BAR is mapped to address 0"),
0 => panic!("BAR 0 is mapped to address 0"),
_ => ptr,
},
other => panic!("Expected memory bar, found {}", other),