mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Pacify the linter for supporting multiple devices
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bbca1a2a80
commit
605a237d53
@ -44,7 +44,8 @@ impl BLKComponent {
|
||||
pub fn init() -> Result<Self, ComponentInitError> {
|
||||
let virtio = jinux_virtio::VIRTIO_COMPONENT.get().unwrap();
|
||||
let devices = virtio.get_device(VirtioDeviceType::Block);
|
||||
for device in devices {
|
||||
// FIXME: deal with multiple block devices
|
||||
if let Some(device) = devices.into_iter().next() {
|
||||
let v_device = VirtioBlockDevice::new(device);
|
||||
return Ok(Self {
|
||||
blk_device: Arc::new(v_device),
|
||||
|
@ -41,9 +41,9 @@ pub fn probe_virtio_net() -> Result<VirtioNet, ComponentInitError> {
|
||||
virtio.get_device(VirtioDeviceType::Network)
|
||||
};
|
||||
|
||||
for device in network_devices {
|
||||
// FIXME: deal with multiple net devices
|
||||
if let Some(device) = network_devices.into_iter().next() {
|
||||
let virtio_net = VirtioNet::new(device);
|
||||
// FIXME: deal with multiple net devices
|
||||
return Ok(virtio_net);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user