Skip to content
Snippets Groups Projects
Commit cc77b95a authored by Wei Wang's avatar Wei Wang Committed by Sean Christopherson
Browse files

kvm/eventfd: use list_for_each_entry when deassign ioeventfd


Simpify kvm_deassign_ioeventfd_idx to use list_for_each_entry as the
loop just ends at the entry that's found and deleted.

Note, coalesced_mmio_ops and ioeventfd_ops are the only instances of
kvm_io_device_ops that implement a destructor, all other callers of
kvm_io_bus_unregister_dev() are unaffected by this change.

Suggested-by: default avatarMichal Luczaj <mhal@rbox.co>
Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20230207123713.3905-3-wei.w.wang@intel.com


[sean: call out that only select users implement a destructor]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 5ea5ca3c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment