]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/i386/intel_iommu: Simplify vtd_find_as_from_bus_num() logic
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 5 Mar 2020 10:27:02 +0000 (11:27 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 8 Mar 2020 13:27:09 +0000 (09:27 -0400)
commita6f65f4fc217713ee2c78b99baae1cc31c761778
tree1a43b58ded6129084fda0047909f563bbc5ed2b7
parentf1e92c3d52d2223306a1ea289a57fca2bc5c40a5
hw/i386/intel_iommu: Simplify vtd_find_as_from_bus_num() logic

The vtd_find_as_from_bus_num() function was introduced (in commit
dbaabb25f) in a code format that could return an incorrect pointer,
which was later fixed by commit a2e1cd41ccf.
We could have avoided this by writing the if() statement differently.
Do it now, in case this function is re-used. The code is easier to
review (harder to miss bugs).

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200305102702.31512-1-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c