Skip to content

Return None rather than size 0 for unused BARs #717

Return None rather than size 0 for unused BARs

Return None rather than size 0 for unused BARs #717

Triggered via pull request May 7, 2025 10:38
@qwandorqwandor
opened #192
bars
Status Success
Total duration 3m 5s
Artifacts

main.yml

on: pull_request
Matrix: examples
Fit to window
Zoom out
Zoom in

Annotations

12 warnings
unnecessary closure used to substitute value for `Option::None`: src/transport/x86_64.rs#L292
warning: unnecessary closure used to substitute value for `Option::None` --> src/transport/x86_64.rs:292:20 | 292 | let bar_info = root | ____________________^ 293 | | .bar_info(device_function, struct_info.bar)? 294 | | .ok_or_else(|| VirtioPciError::BarNotAllocated(struct_info.bar))?; | |________________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations help: use `ok_or` instead | 294 - .ok_or_else(|| VirtioPciError::BarNotAllocated(struct_info.bar))?; 294 + .ok_or(VirtioPciError::BarNotAllocated(struct_info.bar))?; |
unnecessary closure used to substitute value for `Option::None`: src/transport/pci.rs#L421
warning: unnecessary closure used to substitute value for `Option::None` --> src/transport/pci.rs:421:20 | 421 | let bar_info = root | ____________________^ 422 | | .bar_info(device_function, struct_info.bar)? 423 | | .ok_or_else(|| VirtioPciError::BarNotAllocated(struct_info.bar))?; | |________________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default help: use `ok_or` instead | 423 - .ok_or_else(|| VirtioPciError::BarNotAllocated(struct_info.bar))?; 423 + .ok_or(VirtioPciError::BarNotAllocated(struct_info.bar))?; |
this function has too many arguments (8/7): src/device/sound.rs#L365
warning: this function has too many arguments (8/7) --> src/device/sound.rs:365:5 | 365 | / pub fn pcm_set_params( 366 | | &mut self, 367 | | stream_id: u32, 368 | | buffer_bytes: u32, ... | 373 | | rate: PcmRate, 374 | | ) -> Result { | |_______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): src/device/gpu.rs#L267
warning: this function has too many arguments (8/7) --> src/device/gpu.rs:267:5 | 267 | / fn update_cursor( 268 | | &mut self, 269 | | resource_id: u32, 270 | | scanout_id: u32, ... | 275 | | is_move: bool, 276 | | ) -> Result { | |_______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
build
`virtio-drivers` (lib) generated 3 warnings (run `cargo fix --lib -p virtio-drivers` to apply 1 suggestion)
build: src/queue.rs#L80
unused variable: `indirect`
build: src/config.rs#L114
unused import: `write_config`
build: src/config.rs#L100
unused macro definition: `write_config`
build
`virtio-drivers` (lib) generated 3 warnings (run `cargo fix --lib -p virtio-drivers` to apply 1 suggestion)
build: src/queue.rs#L80
unused variable: `indirect`
build: src/config.rs#L114
unused import: `write_config`
build: src/config.rs#L100
unused macro definition: `write_config`